<html ng-app="app">
<head>
    <meta charset="utf-8" >
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <title>将军大厅</title>
    <link rel="stylesheet" href="<?php echo $image_url;?>files/css/loading.css">
    <script type="text/javascript" src="<?php echo $image_url;?>files/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="<?php echo $image_url;?>files/js/angular.min.js"></script>
    <script type="text/javascript" src="<?php echo $image_url;?>files/js/fastclick.js"></script>
    <!--广播-->
    <script type="text/javascript" src="<?php echo $image_url;?>files/js/jquery.marquee.min.js"></script>
    <!--广播 end-->
    <link rel="stylesheet" type="text/css" href="<?php echo $image_url;?>files/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="<?php echo $image_url;?>files/layui/extend/tableFilter.css">
    <script type="text/javascript" src="<?php //echo $image_url;?>http://be.girlsmxx.com/files/layui/layui.js"></script>
    <script type="text/javascript" src="<?php echo $image_url;?>files/layer/mobile/layer.js"></script>
    <script>
        layui.extend({
            tableFilter: '{/}<?php //echo $image_url;?>http://be.girlsmxx.com/files/layui/extend/tableFilter' // {/}的意思即代表采用自有路径，即不跟随 base 路径
        })
        //一般直接写在一个js文件中
        layui.use(['jquery', 'table', 'code', 'tableFilter','laydate'], function(){
            var $ = layui.jquery,
                table = layui.table,
                tableFilter = layui.tableFilter,
                laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#starttime' //指定元素
                ,type: 'datetime'
                ,format: 'yyyy-MM-dd HH:mm'
                ,min: -2 //7天前
                ,max: 1//7天后
            });
            laydate.render({
                elem: '#endtime' //指定元素
                ,type: 'datetime'
                ,format: 'yyyy-MM-dd HH:mm'
                ,min: -2 //7天前
                ,max: 1 //7天后
            });
            var json = <?php echo json_encode($scoreList == -2 ? [] :$scoreList)?>;
            var localtable = table.render({
                elem: '#localtable',
                page: false,
                totalRow : true,
                data:json,
                toolbar: '#barDemo',
                defaultToolbar: ['filter'],
                limit: 1000,
                cols: [[
                    {field: 'headimgurl', title: '头像',width:42,templet:function (d) {
                            return '<img style="width:32px" src="'+ d.headimgurl +'">'
                        }},
                    {field: 'room_number',  title: '房间', templet: function(d){
                            return '房号'+ d.room_number +'<br>时间<span style="color: #c00;">'+ d.create_time +'</span>'
                        }},
                    {field: 'nickname', title: '昵称'},
                    {field: 'score', title: '积分', width: 52, totalRow:true}
                ]],
                done: function(res, curr, count){

                }
            });

            table.on('toolbar(demo)', function(obj){

                if(obj.event == "searchData"){
                    var linkurl = "<?php base_url("f/ss") ?>";
                    if($("#starttime").val() == ""){
                        layer.alert("请选择日期时间");
                        return false;
                    }else {
                        linkurl += "?start_time="+$("#starttime").val();
                    }

                    if($("#endtime").val() != ""){
                        linkurl += "&end_time="+$("#endtime").val();
                    }
                    linkurl += "&game_type=" +$("#game_type").val();
                    location.href = linkurl;

                }

            });
            var localtableFilterIns = tableFilter.render({
                'elem' : '#localtable',
                'parent' : '#table-content',
                'mode' : 'local',
                'filters' : [
                    {field: 'nickname', type:'checkbox'},
                    {field: 'room_number', type:'checkbox'}
                ],
                'done': function(filters){}
            })
        });
      

        function dateTimeStamp(date) {
            //将日期转换成时间戳
            if(date== ""){
                return 0
            }
            var arrs = reMatch(date),
                newdate = new Date(arrs[0],arrs[1]-1,arrs[2],arrs[3]||0,arrs[4]||0,arrs[5]||0),
                timeStr = Math.round(newdate.getTime() / 1000);
            return timeStr;

        }
         function reMatch  (str) {
            var smarr = [],maStr = "", parti = /(^\w{4}|\w{2}\B)/g;
            if(isNum(str)){
                maStr =  str.replace(parti,"$1-");
            }else{
                maStr = /^[A-Za-z]+$/.test(str) ? str.replace(parti,"$1-") : str;
            }
            $.each(maStr.match(/\w+|d+/g),function (i,val) {
                smarr.push(isNum(val) ? parseInt(val):val);
            });
            return smarr;
        }
        function isNum (value){
            return /^[+-]?\d*\.?\d*$/.test(value) ? true : false;
        }
    </script>
    <script>
    var userData = {
        "accountId": "<?php echo $user['account_id'];?>",
        "nickname": "<?php echo $user['nickname'];?>",
        "avatar": "<?php echo $user['headimgurl'];?>",
        "card": "<?php echo $card;?>",
        "isManageOn": <?php echo $user['is_manage_on'];?>,
        "userCode":"<?php echo $user['user_code'];?>",
        "phone":"<?php echo $user['phone'];?>",
        "myCode":"<?php echo $user['my_code']==-1||$user['my_code']=='-1'||$user['my_code']==''?20000+$user['user_code']:$user['my_code'];?>",
    };

var pageii;
//$(function(){
  //  if(userData.phone == ""){
   //     clickPhone();
   // }
//});
function checkData(password,min){
    if (password == '' || password == undefined) {
		return false;
	}
    if(password.length >12 || password.length<min){
	   return false;
	}else{
	  return true;
	}
}


    function clickPhone() {
        pageii = layer.open({
            title: [
                '账号绑定',
                'background-color:rgb(64,112,251); color:#fff;margin:0'
            ]
            ,shadeClose: false
            ,btn:"我已记住账号和密码，立即绑定"
            ,yes:function(index){
                $("#message").html("");
                var phone = $("#phone").val();
                if ( !checkData(phone,4)){
                    $("#message").html("账号格式不正确");
                    return false;
                }
                var authcode = $("#smscode").val();
                //if (!checkAuthcode(authcode)) {
                //    $("#message").html("验证码格式不正确");
                //    return false;
                //}
                var password = $("#password").val();
                if (!checkData(password,6) ) {
                    $("#message").html("密码太短");
                    return false;
                }
                var data = {"dealer_num": 2, "phone":phone, "code":'1111',"password":password};                
                $.ajax( '<?php echo $base_url;?>/account/checkSmsCode', {
                    method: 'POST',
                    contentType: 'application/json;charset=utf-8',
                    data: JSON.stringify(data),
                    success:function(response) {
                        var bodyData = $.parseJSON(response);
                        if (bodyData.result == -1) {
                            $("#message").text(bodyData.result_message);
                        }else {
                            //提示
                            layer.open({
                                content: '修改成功'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                            setTimeout(function () {
                                location.reload();
                            },1000)
                        }
                    }
                });

                return false;
            }
            ,content: $("#validePhone").val()
            ,anim: 'up'
        });
    }

    </script>

</head>
<style>
    *{padding: 0;margin:0;}a {text-decoration: none;color: #fff;}ul {list-style: none;}input{border: none;outline:none}body{font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', 微软雅黑, Arial, sans-serif;cursor: default;}
    img{border: none;}
    .main{width: 100%;position:relative;margin:0 auto;}
    .roomCard{position: absolute;top:0;right:0;width: 26%;}
    .roomCard .img1{position: relative;float: left;z-index: 50;}
    .roomCard .img2{position: absolute;top:0;z-index: 51}
    .roomCard .num{position: relative;background: #273151;color:#fff;font-size: 3.5vw;border-radius:4vw;padding: 1vw 4vw;float: left;margin-left: -3vw;z-index: 49;}

    .recharge{position: absolute;top:5vw;right:30%;width: 22vw;height: 8vw;z-index: 51;}

    .user{position: absolute;top:0;left:0;width: 50%;}
    .user .avatar{border: 1px solid #b495d8;border-radius:5px;float: left;position: relative;z-index: 50;}
    .user .name{color: #fff;font-size: 3.5vw;border-radius:3.5vw;padding: 1vw 4vw;background:#273151;margin-left: -3vw;float: left;position: relative;z-index: 49;}

    .shop{position: fixed;width: 100%;height:100%;top:0;left:0;z-index: 112;}
    .shop .shopBack{width: 100%;height:100%;background: #000;opacity:0.6;}
    .shop .shopBody{width: 100%;position: absolute;bottom: 0;left:0;height: 0; }
    .shop .shopBody .shopReturn{width: 15%;float: left;margin-top:6.3%;margin-left:5%;position: relative;}
    .shop .shopBody .shopBuy{width: 34%;float: right;margin-top:8.3%;margin-right:33%;position: relative;}
    .shop .shopBody .shopGoods{width: 34%;position: relative;padding: 3px;}
    .shop .shopBody .shopGoods img{width: 100%;border-radius: 10px;}
    .shop .shopBody .shopGoods .title{position: absolute;top: 3;font-size: 14px;left: 0;width: 100%;text-align: center;color: #fff;}
    .shop .shopBody .shopGoods .price{position: absolute;bottom: 3;font-size: 20px;left: 0;width: 100%;text-align: center;color: #f1c818;line-height: 36px;}
    .shop .shopBody .goodsBack{border:3px solid #fada23;padding: 0;border-radius: 14px;}
    .shop .shopBody .goodsBack .title{top: 0;}
    .shop .shopBody .goodsBack .price{bottom: 0;}
    .shop .shopBody .goodsBack .background{position: absolute;top:0;left: 0;width:100%;height:100%;background:#fada23;opacity:.15; }
    .shop .shopBody .shopGoods1{margin-top:39%;margin-left: 11.2%;float: left;}
    .shop .shopBody .shopGoods2{margin-top:39%;margin-right: 11.2%;float: right;}
    .shop .shopBody .shopGoods3{margin-top:7.2%;margin-left: 11.2%;float: left;}
    .shop .shopBody .shopGoods4{margin-top:7.2%;margin-right: 11.2%;float: right;}
    .shop .shopLoading{width: 100%;position: absolute;left: 0;top:0;height: 100%;z-index: 9;}


    .alert{position: fixed;width: 100%;height:100%;top:0;left:0;z-index: 111;color: #fff;font-family: simHei;}
    .alert .alertBack{width: 100%;height:100%;background: #000;opacity:0.8;position: absolute;}
    .alert .mainPart{position: relative;top: 45%;left: 50%;margin-top:-19vh ;margin-left:-22.5vh ;width: 45vh;height:38vh; }
    /*.alert .mainPart .backImg{position: relative;width:100%;height:100%;border-radius: 10px;}*/
    .alert .mainPart .alertText{position: absolute;width:100%;line-height: 3.5vh;font-size: 2.5vh;width: 36vh;left:50%;margin-left:-18vh;top:5.6vh;text-align: center;}
    .alert .mainPart .buttonMiddle{position: absolute;width:100%;line-height: 6vh;height: 5.6vh;font-size: 2.5vh;width: 18vh;left:50%;margin-left:-9vh;bottom:2.2vh;text-align: center;background:url("<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/game/button2.png");background-size:100%;}
    .alert .mainPart .buttonLeft{position: absolute;width:100%;line-height: 6vh;height: 5.6vh;font-size: 2.5vh;width: 18vh;left:3vh;bottom:2.2vh;text-align: center;background:url("<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/game/button1.png");background-size:100%;}
    .alert .mainPart .buttonRight{position: absolute;width:100%;line-height: 6vh;height: 5.6vh;font-size: 2.5vh;width: 18vh;right:3vh;bottom:2.2vh;text-align: center;background:url("<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/game/button2.png");background-size:100%;}
    .alert .mainPart .backImg{position: absolute;width:100%;height:100%;border-radius: 1.5vh;border:0.1vh solid #de51f1;top:0;left:0;background: #6d4ba8;}
    .alert .mainPart .backImg .blackImg{position: absolute;width:40.6vh;height:25vh;border-radius: 1.5vh;border:0.1vh solid #ae71cb;top:2.2vh;left:2.2vh;background: #190d2d;}

    .createRoom .mainPart .blueBack .selectPart .selectList .selectItem .text{float: left;margin-left: 0.5vh;}
    .createRoom .mainPart .blueBack .selectPart .selectList .selectItem select
    {
        appearance:none;
        -moz-appearance:none;
        -webkit-appearance:none;
        text-indent: 1.5vh;
        position: relative;;
        width: 8vh;
        height:3.6vh;
        left: 0.3vh;
        top:0.5vh;
        background-size: 100% 100%;
        background-image: url("<?php echo $image_url;?>files/images/common/btnselect.png");
    }


    /* 血拼金花新增提示框样式 */
    .alertTip{position: fixed;width: 40%;height:20%;top:40%;left:30%;z-index: 111;}
    .alertTip .alertTipBG{width: 100%;height:100%;background: #000;opacity:0.5;position: absolute;border-radius: 2vh}
    .alertTip img{position: absolute; margin-left: 15%;}
    .alertTip .alertTipText{position: absolute;bottom: 2vh;width: 100%; text-align: center;color: #fff;font-family: simHei;}
    #table-content .layui-table td, .layui-table th{ }
    #table-content{background: #fff;}
    #table-content .time{ color: #ac2925}
    #table-content .layui-form-checkbox span{ height: auto;}
    #table-content .layui-table-cell{height: auto; padding: 0 5px;line-height: 1.5;}
    #table-content .layui-table-view{ margin: 0px;}
    #table-content .layui-table-body{height: 60.5vh}
    #table-content .layui-table-tool{ padding: 5px; min-height: 20px;  height: 16vh;}
    #table-content .layui-table-tool-temp{ padding-right: 0;}
    #table-content .layui-table-header{overflow:visible;}
</style>
<body ng-controller="myCtrl" style="background: url(<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/home/bg.jpg) #000;" >
<!-- 绑定手机号码 -->
		<textarea id="validePhone" style="display: none;" >
			<div class="phoneFrame">
				<div style="text-align: left;height: 15vw;word-wrap: break-word;word-break: break-all;color: #000;background-color: white;border-top: solid;border-color: #e6e6e6;border-width: 0px;">
					<input type="number" id="phone" name="phone" placeholder="请自由设置您的账号" style="float: left;padding:0 12px 0 12px;width: 65vw;height: 11vw;line-height: 6.5vw;border-style: solid;border-width: 1px;border-radius: 0.5vh;border-color: #e6e6e6;font-size: 4vw;-webkit-appearance: none;">
					<!--<div id="authcode" onclick="JQgetAuthcode()" style="text-align:center;background-color:rgb(64,112,251);float: left; width: 22vw;height: 11.5vw;line-height: 11.5vw;font-size: 3.5vw;border-radius: 0.5vh;color: white;">
						发送验证码
					</div>-->
				</div>
				<!--<div style="text-align: left;height: 15vw;word-wrap: break-word;word-break: break-all;color: #000;background-color: white;border-top: solid;border-color: #e6e6e6;border-width: 0px;">
					<input type="number" id="smscode" name="smscode" placeholder="输入验证码" style="padding:0 12px 0 12px;left: 4vw;width: 65vw;height: 11vw;line-height: 6.5vw;border-style: solid;border-width: 1px;border-radius: 0.5vh;border-color: #e6e6e6;font-size: 4vw;-webkit-appearance: none;">
				</div>-->
				<div style="text-align: left;height: 15vw;word-wrap: break-word;word-break: break-all;color: #000;background-color: white;border-top: solid;border-color: #e6e6e6;border-width: 0px;">
					<input type="text" id="password" name="password" placeholder="设置登录密码" maxlength="12" style="padding:0 12px 0 12px;left: 4vw;width: 65vw;height: 11vw;line-height: 6.5vw;border-style: solid;border-width: 1px;border-radius: 0.5vh;border-color: #e6e6e6;font-size: 4vw;-webkit-appearance: none;">
				</div>
                <div id="message" style="color: #ff0000; text-align: left;"></div>
			</div>
		</textarea>

<div style="position: fixed;width:100%;height:100%;top:0;left:0;background: #000" id="loading">
    <img src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/loading.gif" style="top: 40%;position: absolute;left: 50%;margin-left: -45px;margin-top: -45px;" />
</div>
<div class="main" style="display: none;">

    <!--广播-->
    <div ng-show="isShowNoty" style="position: absolute;background-color: rgba(0,0,0,0.6);width: 100%;height: 4vh;line-height: 4vh;color: white;font-size: 2.5vh;overflow: hidden;z-index: 9998;">
        <img style="position: absolute;top: 0vh;left: 3vw;width: 4vh;height: 4vh;" src="<?php echo $image_url;?>files/images/common/laba.png">
    </div>
    <div ng-show="isShowNoty" id="marquee" style="position: absolute;top: 0;left: 12vw;background-color: rgba(0,0,0,0);width: 88vw;height: 4vh;line-height: 4vh;color: white;font-size: 2.5vh;overflow: hidden;z-index: 9999;">
        {{notyMsg}}
    </div>
    <!--end-->
    <!-- 血拼金花新增提示框 -->
    <div class="alertTip" ng-show="isShowAlertTip">
        <div class="alertTipBG"></div>
        <img src="<?php echo $image_url;?>files/images/common/alertTipOk.png" ng-show="alertTipType==1">
        <img src="<?php echo $image_url;?>files/images/common/alertTipWarn.png" ng-show="alertTipType==2">
        <div class="alertTipText" >{{alertTipText}}</div>
    </div>
    <div class="alert" ng-show="isShowAlert">
        <div class="alertBack"></div>
        <div class="mainPart">
            <div class="backImg">
                <div class="blackImg"></div>
            </div>
            <div class="alertText" >{{alertText}}</div>
            <div ng-show="alertType==1">
                <div class="buttonMiddle" ng-click="closeAlert()">确定</div>
            </div>
            <div ng-show="alertType==2">
                <div class="buttonLeft" ng-click="home()">返回首页</div>
                <div class="buttonRight" ng-click="createRoom()">创建房间</div>
            </div>
            <div ng-show="alertType==3">
                <div class="buttonLeft" ng-click="home()">返回首页</div>
                <div class="buttonRight" ng-click="closeAlert()">取消</div>
            </div>
            <div ng-show="alertType==4">
                <div class="buttonLeft" ng-click="createRoom()">创建房间</div>
                <div class="buttonRight" ng-click="sitDown()">加入游戏</div>
            </div>
            <div ng-show="alertType==5">
                <div class="buttonMiddle" ng-click="getCards()">领取</div>
            </div>
            <div ng-show="alertType==6">
                <div class="buttonMiddle" ng-click="closeAlert()">确定</div>
            </div>
            <div ng-show="alertType==23">
                <div class="buttonMiddle" ng-click="finishBindPhone()">确定</div>
            </div>
            <div ng-show="alertType==31">
                <div class="buttonMiddle" ng-click="reloadView()">确定</div>
            </div>
        </div>
    </div>
    <link rel="stylesheet" href="<?php echo $image_url;?>files/js/swiper/css/swiper.min.css">
    <style>
        * { touch-action: pan-y; }
        body{background:url(<?php echo $image_url;?>files/images/custom/uuhd/bg2.jpg) no-repeat 0 0 / 100% 100%;}
        html,body {
            height:100%;padding:0px; margin:0px;
        }
        html {
            overflow:hidden;
        }
        * {
            padding:0;
            margin:0;
        }
        li {
            list-style:none;
        }
        .img img {
            width:100%;
            display:block;
        }
        #page {
            /*margin-bottom:50px;*/
            height:100%;
        }
        #page .slidepage {
            height:100%;
        }
        .scroll {
            height:100%;
        }
        .slidescroll {
            height:auto;
        }
        .customcss ul{
            width:90vw; padding:0 5vw;
        }
        .customcss ul li{
            width:50%; float:left; text-align:center;
        }
        .customcss ul li span{
            width:100%; height:26vw; float:left;
        }
        .customcss ul li span a{
            width: 80%; height: 18vw; margin-left: 10%;margin-top: 5vw; border-radius:15vw;background:none; float:left;
        }

        .splitline{
            position:relative;width:40.6vh;left:0.2vh;
        }
    </style>
    <div style="position:absolute;height:10vh;width:100vw;background:url(<?php echo $image_url;?>files/images/custom/ks/topbg.png) no-repeat 0 0 / 100% 100%">
        <div style="position:absolute;height:7vh;width:7vh;left:3vw;top:1vh;border:#7A61AD 2px solid;border-radius:5px;overflow:hidden;">
            <img ng-src="{{userInfo.avatar}}" style="border-radius:3px;height:7vh;width:7vh;">
        </div>
        <div style="text-shadow:1PX 1PX 1PX #000;min-width:16vw;max-width:35vw;position:absolute;top:1vh;left:10vh;color:#fff;font-size:0.9em;">{{userInfo.name}}</div>
        <img src="<?php echo $image_url;?>files/images/custom/ks/card.png" style="position:absolute;height:4vh;left:10vh;top:4.5vh;z-index:100;">
        <span style="position:absolute;height:3vh;line-height:3vh;top:5vh;z-index:1;left:11vh;min-width:10vh;max-width:16vh;color:#fff;font-size:0.8em;background:#321650;border:#747EBC 1px solid;border-radius:2vh;padding-left:1vh;text-align:center;">{{userInfo.card}}
    </div>
<!--    <a onclick="changeGongHui()"><img src="--><?php //echo $image_url;?><!--files/images/custom/ks/gonghui.png" style="position:absolute;top:2vh;width:11vw;height:7vh;right:42vw;"></a>-->
<!--    <img src="--><?php //echo $image_url;?><!--files/images/custom/ks/vline.png" style="position:absolute;top:0vh;width:1vw;height:9vh;right:40vw;">-->
    <a href="/f/ym"><img src="<?php echo $image_url;?>files/images/custom/ks/gotohome.png" style="position:absolute;top:2vh;width:11vw;height:7vh;right:28vw;"></a>
    <img src="<?php echo $image_url;?>files/images/custom/ks/vline.png" style="position:absolute;top:0vh;width:1vw;height:9vh;right:26vw;">
    <a href="/f/yh"><img src="<?php echo $image_url;?>files/images/custom/ks/persional.png" style="position:absolute;top:2vh;width:11vw;height:7vh;right:15vw;"></a>
    <img src="<?php echo $image_url;?>files/images/custom/ks/vline.png" style="position:absolute;top:0vh;width:1vw;height:9vh;right:13vw;">
    <a href="/ay/rp"><img src="<?php echo $image_url;?>files/images/custom/ks/sendcard.png" style="position:absolute;top:2vh;width:11vw;height:7vh;right:1vw;"></a>
</div>
<div></div>
<div style="width:100vw;height:90vh;position:absolute;top:10vh;z-index:1;" id="table-content">
    <script type="text/html" id="barDemo">
        <div class="layui-inline">
            <input type="text" value="<?php echo $searchArr['start_time'] ?>" readonly="readonly" style="width: 40vw;" class="layui-input" id="starttime">
        </div>
        <div class="layui-inline">
            <input type="text" value="<?php echo $searchArr['end_time'] ?>" readonly="readonly" style="width: 40vw;" class="layui-input" id="endtime">
        </div>
        <div class="layui-inline">
            <select name="game_type" id="game_type" lay-verify="required">
                <option value="26" <?php echo $searchArr['game_type'] == "26" ? "selected":""; ?>>六人炸金花</option>
                <option value="29" <?php echo $searchArr['game_type'] == "29" ? "selected":"" ?>>九人炸金花</option>
                <option value="24" <?php echo $searchArr['game_type'] == "24" ? "selected":"" ?>>明牌炸金花</option>
                <option value="25" <?php echo $searchArr['game_type'] == "25" ? "selected":"" ?>>血拼炸金花</option>
                <option value="30" <?php echo $searchArr['game_type'] == "30" ? "selected":"" ?>>十二人金花</option>
                <option value="2" <?php echo $searchArr['game_type'] == "2" ? "selected":"" ?>>斗地主</option>
                <option value="3" <?php echo $searchArr['game_type'] == "3" ? "selected":"" ?>>三公</option>
                <option value="22" <?php echo $searchArr['game_type'] == "22" ? "selected":"" ?>>九人三公</option>
                <option value="6" <?php echo $searchArr['game_type'] == "6" ? "selected":"" ?>>麻将</option>
                <option value="19" <?php echo $searchArr['game_type'] == "19" ? "selected":"" ?>>九人牌九</option>
                <option value="8" <?php echo $searchArr['game_type'] == "8" ? "selected":"" ?>>二八杠</option>
                <option value="59" <?php echo $searchArr['game_type'] == "59" ? "selected":"" ?>>九人牛牛</option>
                <option value="55" <?php echo $searchArr['game_type'] == "55" ? "selected":"" ?>>六人牛牛</option>
                <option value="52" <?php echo $searchArr['game_type'] == "52" ? "selected":"" ?>>十二人牛牛</option>
                <option value="56" <?php echo $searchArr['game_type'] == "56" ? "selected":"" ?>>十人牛牛</option>
                <option value="58" <?php echo $searchArr['game_type'] == "58" ? "selected":"" ?>>九人八倍牛牛</option>
                <option value="53" <?php echo $searchArr['game_type'] == "53" ? "selected":"" ?>>癞子牛牛</option>
                <option value="20" <?php echo $searchArr['game_type'] == "20" ? "selected":"" ?>>大吃小</option>
                <option value="21" <?php echo $searchArr['game_type'] == "21" ? "selected":"" ?>>鱼虾蟹</option>
            </select>
        </div>
        <div class="layui-inline">
            <button class="layui-btn layui-btn-sm" lay-event="searchData">确定</button>
        </div>
    </script>
    <table id="localtable" lay-filter="demo"></table>
<!--    <table id="localtable" lay-filter="demo">-->
<!--        <thead>-->
<!--        <tr>-->
<!--            <th lay-data="{field: 'headimgurl',width:42}">头像</th>-->
<!--            <th lay-data="{field: 'room_number'}">房间号</th>-->
<!--            <th lay-data="{field: 'nickname',totalRowText:'积分总计'}">昵称</th>-->
<!--            <th lay-data="{field: 'score', totalRow:true,width:42}">积分</th>-->
<!--        </tr>-->
<!--        </thead>-->
<!--        <tbody>-->
<!--        --><?php //foreach ($scoreList as $score){ ?>
<!--            <tr>-->
<!--                <td><img style="width: 32px;" src="--><?php //echo $score['headimgurl'];?><!--"></td>-->
<!--                <td>--><?php //echo "房号".$score['room_number']?><!--<br>-->
<!--                    时间--><?php //echo $score['create_time']?><!--</td>-->
<!--                <td>--><?php //echo $score['nickname']?><!--</td>-->
<!--                <td>--><?php //echo $score['score']?><!--</td>-->
<!--            </tr>-->
<!--        --><?php //}?>
<!--        </tbody>-->
<!--    </table>-->

<!--    <div class="swiper-container scroll">-->
<!--        <div class="swiper-wrapper">-->
<!--            <div class="swiper-slide slidescroll customcss">-->
<!--                ---->
<!--            </div>-->
<!--        </div>-->
<!--    </div>-->
</div>

<script>
    function changeGongHui(){
        pageii = layer.open({
            title: [
                '选择俱乐部',
                'background-color:rgb(64,112,251); color:#fff;margin:0'
            ]
            ,content: "<?php  foreach ($manageList as $key=>$account){
                if ( $_GET["manage_id"] == $account['account_id'] || (empty($_GET["manage_id"]) && $key == 0))
                    echo "<div style='clear:both; text-align:left; background: #EBF3EC;'><span style='color:#000;line-height:2; '>".$account["nickname"]."的俱乐部</span></div>";
                else
                    echo "<div style='clear:both; text-align:left;'><a style='color:#000;line-height:2;' href='".base_url()."f/gh?manage_id=".$account['account_id']."'>".$account["nickname"]."的俱乐部</a></div>";
            }?>"
            ,anim: 'up'
        });
    }
    //跳转到房间或战绩查询
    function gotoRoom(roomId,gameType,room_number){
        var str = decodeGameType(gameType) ;
        skipUrl = "<?php echo base_url()?>f/"+str+"?i="+room_number+"_";
        window.location.href = skipUrl ;
    }

    //将游戏类型解析成uri
    function decodeGameType(type){
        var str = "";
        switch (parseInt(type)){
            case 29: str = "z9"; break;
            case 30: str = "z12"; break;
            case 26: str = "yf"; break;
            case 25: str = "xpjh"; break;
            case 24: str = "mpZjh";break;

            case 59: str = "nb"; break;
            case 58: str = "b8b"; break;
            case 56: str = "b6b"; break;
            case 52: str = "mb"; break;
            case 53: str = "laib"; break;
            case 55: str = "b"; break;

            case 2: str = "l"; break;
            case 6: str = "ma"; break;
            case 8: str = "eba"; break;
            case 3: str = "sg"; break;
            case 19: str = "pj"; break;
            case 22: str = "sg9"; break;
            case 20: str = "dcx"; break;
            case 21: str = "yxx"; break;

        };
        return str ;
    }
</script>

<script src="<?php echo $image_url;?>files/js/swiper/js/swiper.min.js"></script>
<script type="text/javascript">
    tSpeed = 300 //切换速度300ms
    //内容滚动
    var scrollSwiper = new Swiper('.scroll', {
        //65是头部的高
        //36是top地址和搜索的高
        slidesOffsetBefore: 0,
        direction: 'vertical',
        freeMode: true,
        slidesPerView: 'auto',
        mousewheel: true,
    });
    // document.addEventListener('touchmove', function(e){e.preventDefault()}, false);
</script>

<style>
    .waiting{position: fixed;width:100%;height:100%;top:0;left:0;z-index: 111;}
    .waiting .waitingBack{position: fixed;width:100%;height:100%;top:0;left:0;background: #000;opacity:.5;}
</style>
<div class="waiting" ng-show="is_operation">
    <div class="waitingBack"></div>
    <div class="load4">
        <div class="loader">Loading...</div>
    </div>
</div>

<div ng-include="'shop.html'" ng-if="isShowShop"></div>
<script type="text/ng-template" id="shop.html">
    <div class="shop">
        <div class="shopBack" ng-click="hideShop()"></div>
        <div class="shopBody" >
            <div style="position: absolute;top:0;left:0;height:100%;width:100%;">
                <img src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/title.png" style="width: 100%;position: relative;z-index: 1" />
                <img src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/body.jpg" style="width: 100%;margin-top: -20px;position: relative;border-radius:15px 15px 0 0;"   />
            </div>
            <div ng-repeat="r in roomCardInfo">
                <div class="shopGoods shopGoods{{r.num}}" ng-click="selectCard(r.goods_id,r.ticket_count)" ng-show="select!=r.goods_id">
                    <img ng-src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/shop_{{r.num}}.jpg"  />
                    <div class="title">{{r.title}}</div>
                    <div class="price">￥{{r.price}}</div>
                </div>
                <div class="shopGoods shopGoods{{r.num}} goodsBack" ng-show="select==r.goods_id">
                    <img ng-src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/shop_{{r.num}}.jpg"  />
                    <div class="title">{{r.title}}</div>
                    <div class="price">￥{{r.price}}</div>
                    <div class="background"></div>
                </div>
            </div>

            <img src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/shop6.png" class="shopReturn" ng-click="hideShop()" />
            <img src="<?php echo $image_url;?>files/d_<?php echo $dealer_num;?>/images/shop/shop5.png" class="shopBuy" ng-click="shopBuy()" ng-show="roomCardInfo.length>0" />
        </div>
        <div class="shopLoading" ng-show="isShowShopLoading">
            <div style="width: 100%;position: absolute;left: 0;top:0;height: 100%;background: #000;opacity:0.6;"></div>
            <div class="load4">
                <div class="loader">Loading...</div>
            </div>
        </div>
    </div>
</script>
</div>
<script type="text/javascript">
    var app=angular.module('app',[]);
    app.directive('ngInput', [function () {
        return {
            restrict: 'A',
            require: '?ngModel',
            link: function(scope, element, attrs) {
                element.on('input',oninput);
                scope.$on('$destroy',function(){//销毁的时候取消事件监听
                    element.off('input',oninput);
                });
                function oninput(event){
                    scope.$evalAsync(attrs['ngInput'],{$event:event,$value:this.value});
                }
            }
        }
    }]);

    app.controller("myCtrl", function($scope,$http) {
        FastClick.attach(document.body);
        $scope.width=window.innerWidth;
        $scope.userInfo={
            "id":"<?php echo $user['account_id'];?>",
            "name":"<?php echo $user['nickname'];?>",
            "avatar":"<?php echo $user['headimgurl'];?>",
            "card":0,
        }
        $scope.socket={
            "bull":"<?php echo $socket55;?>",
            "bull9":"<?php echo $socket59;?>",
            "bull12":"<?php echo $socket52;?>",
            "bull6b":"<?php echo $socket56;?>",
            "bull8b":"<?php echo $socket58;?>",
            "laibull":"<?php echo $socket53;?>",

            "z12":"<?php echo $socket30;?>",
            "xpzjh":"<?php echo $socket25;?>",
            "mpzjh":"<?php echo $socket24;?>",
            "flower":"<?php echo $socket26;?>",
            "z9":"<?php echo $socket29;?>",

            "landlord":"<?php echo $socket2;?>",
            "majiang":"<?php echo $socket4;?>",
            "sg":"<?php echo $socket7;?>",
            "sg9":"<?php echo $socket16;?>",
            "eba":"<?php echo $socket8;?>",

            "paijiu":"<?php echo $socket12;?>",
            "dcx":"<?php echo $socket14;?>",
            "yxx":"<?php echo $socket15;?>"

        }
        $scope.userInfo.card="<?php echo $card;?>";
        $scope.dealerNum = "<?php echo $dealer_num;?>";

///////////////////////socket

        var socketStatus=0;
        $(".main").show();
        $("#loading").hide();
        $scope.roomCardInfo=new Array();
        $scope.activity=new Array();
        $scope.isShowAlert=false;

        // 血拼金花新增提示框
        $scope.isShowAlertTip = false;
        $scope.alertTipType=1;
        $scope.alertTipText="";
        $scope.showAlertTip=function(e,t){
            $scope.isShowAlertTip=true;
            $scope.alertTipText=e;
            $scope.alertTipType=t;
            setTimeout(function(){
                $scope.isShowAlertTip=false;
                $scope.$apply();
            },1000)
        }


        $scope.alertType=0;
        $scope.alertText="";
        $scope.showAlert=function(type,text){
            $(".alertText").css("top","90px")
            $scope.alertType=type;
            $scope.alertText=text;
            $scope.isShowAlert=true;

            setTimeout(function() {
                $scope.$apply();
            }, 0);

            setTimeout(function(){
                var wHeight = window.innerHeight;
                var alertHeight = $(".alertText").height();
                var textHeight = $(".alertText").height();

                if (alertHeight < wHeight * 0.15) {
                    alertHeight = wHeight * 0.15;
                }

                if (alertHeight > wHeight * 0.8) {
                    alertHeight = wHeight * 0.8;
                }

                var mainHeight = alertHeight + wHeight * (0.022 + 0.034) * 2 + wHeight * 0.022 + wHeight * 0.056;
                if (type == 8) {
                    mainHeight = mainHeight - wHeight * 0.022 - wHeight * 0.056
                }

                var blackHeight = alertHeight + wHeight * 0.034 * 2;
                var alertTop = wHeight * 0.022 + (blackHeight - textHeight) / 2;

                $(".alert .mainPart").css('height', mainHeight + 'px');
                $(".alert .mainPart").css('margin-top', '-' + mainHeight / 2 + 'px');
                $(".alert .mainPart .backImg .blackImg").css('height', blackHeight + 'px');
                $(".alert .mainPart .alertText").css('top', alertTop + 'px');

                $scope.$apply();
            },0)
        }
        $scope.closeAlert=function(){
            if($scope.alertType==1){
                $scope.isShowAlert=false;
                $scope.showShop();
                if(!$scope.is_connect){
                    $scope.is_connect=true;
                }
            }
            else{
                $scope.isShowAlert=false;
            }
        }


        $scope.getCards=function(){
            $http({
                url:'<?php echo $base_url;?>game/updateActivityOpt',
                method: 'POST',
                headers:{
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                data:{
                    "account_id":"<?php echo $user['account_id'];?>",
                    "activity_id":$scope.activity[0].activity_id,
                    "dealer_num":"<?php echo $dealer_num;?>",
                    "session":"<?php echo $session;?>",
                },
            }).success(function(data){

                if(data.result==0){
                    $scope.userInfo.card=Math.ceil($scope.userInfo.card)+Math.ceil($scope.activity[0].ticket_count);
                    $scope.activity.splice(0,1);
                    if($scope.activity.length==0){
                        $scope.closeAlert();
                    }
                    else{
                        $scope.showAlert(5,$scope.activity[0].content)
                    }
                }
                else{
                    alert(data.result_message)
                }
            }).error(function(data){

            });
        }

        $http({
            url:'../f/getActivityInfo',
            method: 'POST',
            headers:{
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            data:{
                "account_id":"<?php echo $user['account_id'];?>",
                "dealer_num":"<?php echo $dealer_num;?>",
                "session":"<?php echo $session;?>",
            },
        }).success(function(data){
            if(data.result==0){
                if(data.data.length==0){

                }
                else{
                    $scope.activity=data.data.concat();
                    $scope.showAlert(5,$scope.activity[0].content)
                }
            }
            else{
                alert(data.result_message)
            }
        }).error(function(data){

        });
        $http({
            url:'../f/roomCardInfo',
            method: 'POST',
            headers:{
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            data:{
                "dealer_num":"<?php echo $dealer_num;?>",
                "session":"<?php echo $session;?>",
            },
        }).success(function(data){
            if(data.result==0){
                console.log($scope.roomCardInfo);
                $scope.roomCardInfo=data.data.concat();
                for(var i=0;i<$scope.roomCardInfo.length;i++){
                    $scope.roomCardInfo[i].num=i+1;
                    $scope.roomCardInfo[i].price=Math.ceil($scope.roomCardInfo[i].price);
                }

                if ($scope.roomCardInfo.length >= 1) {
                    $scope.select = $scope.roomCardInfo[0].goods_id;
                }
            }
            else{
                alert(data.result_message)
            }
        }).error(function(data){

        });

        setTimeout(function() {
            $scope.$apply();
        }, 100);


        //广播
        var globalData = {
            "card":"<?php echo $card;?>",
            "isNotyMsg":'<?php echo "$is_announcement"?>',
            "notyMsg":'<?php echo "$announcement_content"?>',
            "notyTime":'<?php echo "$announcement_sec"?>',
            "notySpeed":5000,
        };
        $scope.isShowNoty = false;
        $scope.notyMsg = '';

        setTimeout(function () {
            if (globalData.isNotyMsg != undefined && globalData.isNotyMsg != null) {
                $scope.notyMsg = globalData.notyMsg;
                if (globalData.isNotyMsg == 1) {
                    $scope.isShowNoty = true;
                    setTimeout(function () {
                        $scope.isShowNoty = false;
                        $scope.$apply();
                    }, globalData.notyTime * 1000);
                    $scope.$apply();
                }
            } else {
                globalData.isNotyMsg = 0;
            }

            $('#marquee').marquee({
                //speed in milliseconds of the marquee
                duration: globalData.notySpeed,
                //gap in pixels between the tickers
                gap: 50,
                //time in milliseconds before the marquee will start animating
                delayBeforeStart: 0,
                //'left' or 'right'
                direction: 'left',
                //true or false - should the marquee be duplicated to show an effect of continues flow
                duplicated: true
            });

        }, 50);
        //end

        $scope.is_operation=false;
        $scope.waiting=function(){
            $scope.is_operation=true;
            setTimeout(function(){
                if($scope.is_operation){
                    $scope.is_operation=false;
                    $scope.showAlert(6,"创建房间失败，请重新创建")
                }
            },15000)
        };
        $scope.socket_url="";
        $scope.socket_type="";
        $scope.connectSocket=function(socket,type){
            $scope.socket_url=socket;
            $scope.socket_type=type;
            $scope.ws = new WebSocket(socket);
            $scope.ws.onopen = function(){
                $scope.is_operation=true;
                var tiao=setInterval(function(){
                    socketStatus=socketStatus+1;
                    $scope.ws.send("@");
                    if(socketStatus>3||socketStatus>3){
                        window.location.reload();
                    }
                },4000);

                if(type==2){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_count":$scope.createInfo.landlord.ticket_count,
                            "base_score":$scope.createInfo.landlord.base_score,
                            "ask_mode":$scope.createInfo.landlord.ask_mode,
                        }
                    }));
                }

                else if(type==4){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "joker":$scope.createInfo.majiang.joker,
                            "horse_count":$scope.createInfo.majiang.horse_count,
                            "qianggang":$scope.createInfo.majiang.qianggang,
                            "chengbao":$scope.createInfo.majiang.chengbao,
                            "ticket_count":$scope.createInfo.majiang.ticket_count,
                        }
                    }));
                }

                else if(type==7){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.sangong6.ticket_type,
                            "score_type":$scope.createInfo.sangong6.score_type,
                            "rule_type":$scope.createInfo.sangong6.rule_type,
                            "is_cardjoker":$scope.createInfo.sangong6.is_cardjoker,
                            "is_cardbao9":$scope.createInfo.sangong6.is_cardbao9,
                            "banker_mode":$scope.createInfo.sangong6.banker_mode,
                            "banker_score_type":$scope.createInfo.sangong6.banker_score,
                        }
                    }));
                }
                else if(type==8){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "banker_mode":$scope.createInfo.erbagang.banker_mode,
                            "chip_type":$scope.createInfo.erbagang.chip_type,
                            "score_type":$scope.createInfo.erbagang.score_type,  //上庄分数类型
                            "rule_type":$scope.createInfo.erbagang.rule_type,
                            "ticket_count":$scope.createInfo.erbagang.ticket_count,  //消耗房卡数
                        }
                    }));
                }

                else if(type==12){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.paijiu.ticket_type,
                            "score_type":$scope.createInfo.paijiu.score_type,
                            "banker_mode":$scope.createInfo.paijiu.banker_mode,
                        }
                    }));
                }
                else if(type==14){  //大吃小
                    console.log($scope.createInfo.dcx);
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "max_count_type":$scope.createInfo.dcx.max_count_type,
                            "ticket_type":$scope.createInfo.dcx.ticket_type,
                            "bet_type":$scope.createInfo.dcx.bet_type,
                            "is_cardjoker":$scope.createInfo.dcx.is_cardjoker,
                            "is_cardbao9":$scope.createInfo.dcx.is_cardbao9,
                        }
                    }));
                }
                else if(type==15){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            'chip_type': $scope.createInfo.yxx.chip_type,
                            'ticket_type':$scope.createInfo.yxx.ticket_type,
                            'rule_value1':$scope.createInfo.yxx.rule_value1,
                            'upper_limit':$scope.createInfo.yxx.upper_limit,
                        }
                    }));
                }
                else if(type==16){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.sangong9.ticket_type,
                            "score_type":$scope.createInfo.sangong9.score_type,
                            "rule_type":$scope.createInfo.sangong9.rule_type,
                            "is_cardjoker":$scope.createInfo.sangong9.is_cardjoker,
                            "is_cardbao9":$scope.createInfo.sangong9.is_cardbao9,
                            "banker_mode":$scope.createInfo.sangong9.banker_mode,
                            "banker_score_type":$scope.createInfo.sangong9.banker_score,
                        }
                    }));
                }
                else if(type==26){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            'default_score': $scope.createInfo.flower.default_score,
                            "data_key":Date.parse(new Date())+randomString(5),
                            'chip_type': $scope.createInfo.flower.chip_type,
                            'ticket_count':$scope.createInfo.flower.ticket_count,
                            'disable_pk_100':$scope.createInfo.flower.pkvalue1,
                            'disable_pk_men':$scope.createInfo.flower.pkvalue2,
                            'disable_look':$scope.createInfo.flower.lookvalue,
                            'only_big':$scope.createInfo.flower.only_big,
                            'upper_limit':$scope.createInfo.flower.upper_limit,
                        }
                    }));
                }
                else if(type==29){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            'default_score': $scope.createInfo.z9.default_score,
                            "data_key":Date.parse(new Date())+randomString(5),
                            'chip_type': $scope.createInfo.z9.chip_type,
                            'ticket_count':$scope.createInfo.z9.ticket_count,
                            'disable_pk_100':$scope.createInfo.z9.pkvalue1,
                            'disable_look':$scope.createInfo.z9.lookvalue,
                            'disable_pk_men':$scope.createInfo.z9.pkvalue2,
                            'upper_limit':$scope.createInfo.z9.upper_limit,
                        }
                    }));
                }
                else if(type==24){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "play_mode":$scope.createInfo.flower18.play_mode,
                            //房间人数  2 九人房
                            "max_count_type":2,
                            'default_score': $scope.createInfo.flower18.default_score,
                            'chip_type': $scope.createInfo.flower18.chip_type,
                            'disable_pk':$scope.createInfo.flower18.disable_pk,
                            'disable_look':$scope.createInfo.flower18.disable_look,
                            'upper_limit':$scope.createInfo.flower18.upper_limit,
                            'pk_score': $scope.createInfo.flower18.pk_score,
                            'look_score': $scope.createInfo.flower18.look_score,
                            'ticket_type':$scope.createInfo.flower18.ticket_type,
                        }
                    }));
                }
                else if(type==25){  //血拼炸金花
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            'default_score': $scope.createInfo.flowerxp.default_score,
                            'chip_list': $scope.createInfo.flowerxp.chip_list,
                            'xp_chip': $scope.createInfo.flowerxp.xp_chip,
                            'disable_pk':$scope.createInfo.flowerxp.disable_pk,
                            'bet_circle':$scope.createInfo.flowerxp.bet_circle,
                            'look_cond': $scope.createInfo.flowerxp.look_cond,
                            'pk_cond': $scope.createInfo.flowerxp.pk_cond,
                            'xp_circle': $scope.createInfo.flowerxp.xp_circle,
                            'ticket_type':$scope.createInfo.flowerxp.ticket_type,
                        }
                    }));
                }
                else if(type==30){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            'default_score': $scope.createInfo.z12.default_score,
                            "data_key":Date.parse(new Date())+randomString(5),
                            'chip_type': $scope.createInfo.z12.chip_type,
                            'ticket_count':$scope.createInfo.z12.ticket_count,
                            'disable_pk_100':$scope.createInfo.z12.pkvalue1,
                            'disable_look':$scope.createInfo.z12.lookvalue,
                            'disable_pk_men':$scope.createInfo.z12.pkvalue2,
                            'upper_limit':$scope.createInfo.z12.upper_limit,
                        }
                    }));
                }
                else if(type==55){
                    console.log($scope.createInfo.bull);
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.bull.ticket_type,
                            "score_type":$scope.createInfo.bull.score_type,
                            "rule_type":$scope.createInfo.bull.rule_type,
                            "is_cardfive":$scope.createInfo.bull.is_cardfive,
                            "is_cardbomb":$scope.createInfo.bull.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.bull.is_cardtiny,
                            "is_cardfour":$scope.createInfo.bull.is_cardfour,
                            "is_flush":$scope.createInfo.bull.is_flush,
                            "is_calabash":$scope.createInfo.bull.is_calabash,
                            "is_straight":$scope.createInfo.bull.is_straight,
                            "is_sequence":$scope.createInfo.bull.is_sequence,
                            "banker_mode":$scope.createInfo.bull.banker_mode,
                            "ready_time":$scope.createInfo.bull.ready_time,
                            "grab_time":$scope.createInfo.bull.grab_time,
                            "bet_time":$scope.createInfo.bull.bet_time,
                            "show_time":$scope.createInfo.bull.show_time,
                            "banker_score_type":$scope.createInfo.bull.banker_score,
                            "bet_type":$scope.createInfo.bull.bet_type,
                        }
                    }));
                }
                else if(type==59){
                    console.log($scope.createInfo.bull9);
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.bull9.ticket_type,
                            "score_type":$scope.createInfo.bull9.score_type,
                            "rule_type":$scope.createInfo.bull9.rule_type,
                            "is_cardfive":$scope.createInfo.bull9.is_cardfive,
                            "is_cardbomb":$scope.createInfo.bull9.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.bull9.is_cardtiny,
                            "is_cardfour":$scope.createInfo.bull9.is_cardfour,
                            "is_flush":$scope.createInfo.bull9.is_flush,
                            "is_calabash":$scope.createInfo.bull9.is_calabash,
                            "is_straight":$scope.createInfo.bull9.is_straight,
                            "is_sequence":$scope.createInfo.bull9.is_sequence,
                            "banker_mode":$scope.createInfo.bull9.banker_mode,
                            "ready_time":$scope.createInfo.bull9.ready_time,
                            "grab_time":$scope.createInfo.bull9.grab_time,
                            "bet_time":$scope.createInfo.bull9.bet_time,
                            "show_time":$scope.createInfo.bull9.show_time,
                            "banker_score_type":$scope.createInfo.bull9.banker_score,
                            "bet_type":$scope.createInfo.bull9.bet_type,
                        }
                    }));
                }
                else if(type==52){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.bull12.ticket_type,
                            "score_type":$scope.createInfo.bull12.score_type,
                            "rule_type":$scope.createInfo.bull12.rule_type,
                            "is_cardfive":$scope.createInfo.bull12.is_cardfive,
                            "is_cardbomb":$scope.createInfo.bull12.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.bull12.is_cardtiny,
                            "is_cardfour":$scope.createInfo.bull12.is_cardfour,
                            "is_flush":$scope.createInfo.bull12.is_flush,
                            "is_calabash":$scope.createInfo.bull12.is_calabash,
                            "is_straight":$scope.createInfo.bull12.is_straight,
                            "is_sequence":$scope.createInfo.bull12.is_sequence,
                            "banker_mode":$scope.createInfo.bull12.banker_mode,
                            "ready_time":$scope.createInfo.bull12.ready_time,
                            "grab_time":$scope.createInfo.bull12.grab_time,
                            "bet_time":$scope.createInfo.bull12.bet_time,
                            "show_time":$scope.createInfo.bull12.show_time,
                            "banker_score_type":$scope.createInfo.bull12.banker_score,
                            "bet_type":$scope.createInfo.bull12.bet_type,
                        }
                    }));
                }
                else if(type==56){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.bull6b.ticket_type,
                            "score_type":$scope.createInfo.bull6b.score_type,
                            "rule_type":$scope.createInfo.bull6b.rule_type,
                            "is_cardfive":$scope.createInfo.bull6b.is_cardfive,
                            "is_cardbomb":$scope.createInfo.bull6b.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.bull6b.is_cardtiny,
                            "is_cardfour":$scope.createInfo.bull6b.is_cardfour,
                            "is_flush":$scope.createInfo.bull6b.is_flush,
                            "is_calabash":$scope.createInfo.bull6b.is_calabash,
                            "is_straight":$scope.createInfo.bull6b.is_straight,
                            "is_sequence":$scope.createInfo.bull6b.is_sequence,
                            "banker_mode":$scope.createInfo.bull6b.banker_mode,
                            "banker_score_type":$scope.createInfo.bull6b.banker_score,
                            "ready_time":$scope.createInfo.bull6b.ready_time,
                            "grab_time":$scope.createInfo.bull6b.grab_time,
                            "bet_time":$scope.createInfo.bull6b.bet_time,
                            "show_time":$scope.createInfo.bull6b.show_time,
                            "bet_type":$scope.createInfo.bull6b.bet_type
                        }
                    }));
                }


                else if(type==58){
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "ticket_type":$scope.createInfo.bull8b.ticket_type,
                            "score_type":$scope.createInfo.bull8b.score_type,
                            "rule_type":$scope.createInfo.bull8b.rule_type,
                            "is_cardfive":$scope.createInfo.bull8b.is_cardfive,
                            "is_cardbomb":$scope.createInfo.bull8b.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.bull8b.is_cardtiny,
                            "is_cardfour":$scope.createInfo.bull8b.is_cardfour,
                            "is_flush":$scope.createInfo.bull8b.is_flush,
                            "is_calabash":$scope.createInfo.bull8b.is_calabash,
                            "is_straight":$scope.createInfo.bull8b.is_straight,
                            "is_sequence":$scope.createInfo.bull8b.is_sequence,
                            "ready_time":$scope.createInfo.bull8b.ready_time,
                            "grab_time":$scope.createInfo.bull8b.grab_time,
                            "bet_time":$scope.createInfo.bull8b.bet_time,
                            "show_time":$scope.createInfo.bull8b.show_time,
                            "banker_mode":$scope.createInfo.bull8b.banker_mode,
                            "banker_score_type":$scope.createInfo.bull8b.banker_score,
                        }
                    }));
                }
                else if(type==53){  //赖子牛牛
                    //console.log($scope.createInfo.laibull);
                    $scope.ws.send(JSON.stringify({
                        "operation":"CreateRoom",
                        "account_id":"<?php echo $user['account_id'];?>",
                        "session":"<?php echo $session;?>",
                        "data":{
                            "data_key":Date.parse(new Date())+randomString(5),
                            "max_count_type":$scope.createInfo.laibull.max_count_type,
                            "ticket_type":$scope.createInfo.laibull.ticket_type,
                            "score_type":$scope.createInfo.laibull.score_type,
                            "bet_type":$scope.createInfo.laibull.bet_type,
                            "rule_type":$scope.createInfo.laibull.rule_type,
                            "is_cardfive":$scope.createInfo.laibull.is_cardfive,
                            "is_cardbomb":$scope.createInfo.laibull.is_cardbomb,
                            "is_cardtiny":$scope.createInfo.laibull.is_cardtiny,
                            "is_cardfour":$scope.createInfo.laibull.is_cardfour,
                            "is_flush":$scope.createInfo.laibull.is_flush,
                            "is_calabash":$scope.createInfo.laibull.is_calabash,
                            "is_straight":$scope.createInfo.laibull.is_straight,
                            "is_sequence":$scope.createInfo.laibull.is_sequence,
                            "ready_time":$scope.createInfo.laibull.ready_time,
                            "grab_time":$scope.createInfo.laibull.grab_time,
                            "bet_time":$scope.createInfo.laibull.bet_time,
                            "show_time":$scope.createInfo.laibull.show_time,
                            "is_laizi":$scope.createInfo.laibull.is_laizi,
                            "banker_mode":$scope.createInfo.laibull.banker_mode,
                            "banker_score_type":$scope.createInfo.laibull.banker_score,
                        }
                    }));
                }

            };
            $scope.ws.onmessage = function(evt){
                if(evt.data=="@"){
                    socketStatus=0;
                    return 0;
                }
                var obj = eval('(' + evt.data + ')');
                if (obj.result==1){
                    $scope.is_operation=false;
                    $scope.showAlert(1,obj.result_message);
                } else if (obj.result == 0){
                    console.log(type)
                    if(type==2){
                        window.location.href="<?php echo $base_url;?>f/l?i="+obj.data.room_number+"_";
                    } else if(type==4){
                        window.location.href="<?php echo $base_url;?>f/ma?i="+obj.data.room_number+"_";
                    } else if(type==7){
                        window.location.href="<?php echo $base_url;?>f/sg?i="+obj.data.room_number+"_";
                    } else if(type==8){
                        window.location.href="<?php echo $base_url;?>f/eba?i="+obj.data.room_number+"_";
                    } else if(type==12){
                        window.location.href="<?php echo $base_url;?>f/pj?i="+obj.data.room_number+"_";
                    } else if(type==14){
                        window.location.href="<?php echo $base_url;?>f/dcx?i="+obj.data.room_number+"_";
                    } else if(type==15){
                        window.location.href="<?php echo $base_url;?>f/yxx?i="+obj.data.room_number+"_";
                    } else if(type==16){
                        window.location.href="<?php echo $base_url;?>f/sg9?i="+obj.data.room_number+"_";
                    } else if(type==24){
                        window.location.href="<?php echo $base_url;?>f/mpZjh?i="+obj.data.room_number+"_";
                    } else if(type==25){
                        window.location.href="<?php echo $base_url;?>f/xpjh?i="+obj.data.room_number+"_";
                    } else if(type==26){
                        window.location.href="<?php echo $base_url;?>f/yf?i="+obj.data.room_number+"_";
                    } else if(type==29){
                        window.location.href="<?php echo $base_url;?>f/z9?i="+obj.data.room_number+"_";
                    } else if(type==30){
                        window.location.href="<?php echo $base_url;?>f/z12?i="+obj.data.room_number+"_";
                    } else if(type==55){
                        window.location.href="<?php echo $base_url;?>f/b?i="+obj.data.room_number+"_";
                    } else if(type==59){
                        window.location.href="<?php echo $base_url;?>f/nb?i="+obj.data.room_number+"_";
                    } else if(type==52){
                        window.location.href="<?php echo $base_url;?>f/mb?i="+obj.data.room_number+"_";
                    } else if(type==56){
                        window.location.href="<?php echo $base_url;?>f/b6b?i="+obj.data.room_number+"_";
                    } else if(type==58){
                        window.location.href="<?php echo $base_url;?>f/b8b?i="+obj.data.room_number+"_";
                    } else if(type==53){
                        window.location.href="<?php echo $base_url;?>f/laib?i="+obj.data.room_number+"_";
                    }

                }  else if (obj.result == -201){
                    $scope.is_operation=false;
                    $scope.showAlert(31,obj.result_message);
                }  else {
                    $scope.is_operation=false;
                    $scope.showAlert(6,obj.result_message);
                }
            };
            $scope.ws.onclose = function(evt){
                // errorAPI("connectFailed");
                console.log("16500closed");
                if($scope.is_operation){
                    $scope.connectSocket($scope.socket_url,$scope.socket_type);
                }
                else
                    return 0;
                //  window.location.reload();
            }
            $scope.ws.onerror = function(evt){console.log("WebSocketError!");};
        }

        $scope.createInfo={
            "isShow":0,
            //血拼金花
            "flowerxp": localStorage.flowerxp ? JSON.parse(localStorage.flowerxp) : {
                default_score: 4, //底筹
                chip_type: 1,
                disable_pk: 0,
                bet_circle: 10,   //下注圈数
                look_cond: 0,     //必闷圈数
                pk_cond: 1,       //比牌条件
                xp_circle: 1,     //血拼圈数
                ticket_type: 1,
                chip_list:[4,8,16,20], //筹码组
                base_xp_chip:40,    //血拼筹码基准值
                xp_chip:120,       //血拼筹码
                chip_total:[        //所有筹码项
                    {isSelect:!0,num:4},
                    {isSelect:!0,num:8},
                    {isSelect:!0,num:10},
                    {isSelect:!1,num:16},
                    {isSelect:!0,num:20},
                    {isSelect:!1,num:40},
                    {isSelect:!1,num:100},
                    {isSelect:!1,num:200}
                ]
            },
            //明牌炸金花
            "flower18": localStorage.flower18 && (l_flower18=JSON.parse(localStorage.flower18)).play_mode ? l_flower18 : {
                "play_mode":2,       //模式   1经典  2明牌
                "max_count_type":2,   // 1六人房  2九人房
                'default_score': 4,
                'chip_type': 1,
                'disable_look': 0,
                'disable_pk': 0,
                'upper_limit': 1000,
                'pk_score': 0,
                'look_score': 0,
                'ticket_type': 1,
                "mode1":"unselected",
                "mode2":"selected",
            },
            //赖子牛牛 默认建房选项
            "laibull": localStorage.laibull && JSON.parse(localStorage.laibull).ready_time ? JSON.parse(localStorage.laibull) : {
                "max_count_type":1,   // 1九人房  2十二人房
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                "ticket_type":1,
                "score_type":1,
                "rule_type":1,   //规则 1: 牛牛x3牛九x2牛八x2      2: 牛牛x4牛九x3牛八x2牛七x2
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "is_laizi":0,
                "banker_mode":2, //模式 2 明牌抢庄
                "banker_score":4,
                "bet_type":1,
                "banker1":"unselected",
                "banker2":"selected",
            },
            "bull": localStorage.bull && JSON.parse(localStorage.bull).ready_time ? JSON.parse(localStorage.bull) : {
                "ticket_type":2,
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                "bet_type":1,//下注组合
                "score_type":1,
                "rule_type":2,
                // "is_cardfive":1,
                // "is_cardbomb":1,
                // "is_cardtiny":1,
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "banker_mode":2,
                "banker_score":4,
                "banker1":"unselected",
                "banker2":"selected",
                "banker3":"unselected",
                "banker4":"unselected",
                "banker5":"unselected",
            },
            //九人牛牛
            "bull9": localStorage.bull9 && JSON.parse(localStorage.bull9).ready_time ? JSON.parse(localStorage.bull9) : {
                "ticket_type":2,
                "bet_type":1,//下注组合
                "score_type":1,
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                "rule_type":2,
                // "is_cardfive":1,
                // "is_cardbomb":1,
                // "is_cardtiny":1,
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "banker_mode":2,
                "banker_score":4,
                "banker1":"unselected",
                "banker2":"selected",
                "banker3":"unselected",
                "banker4":"unselected",
                "banker5":"unselected",
            },
            //十二人牛牛
            "bull12": localStorage.bull12 && JSON.parse(localStorage.bull12).ready_time ? JSON.parse(localStorage.bull12) : {
                "ticket_type":2,//局数默认是左边还是右边
                "bet_type":1,//下注组合
                "score_type":1,//默认低分 第几项
                "rule_type":2,//规则第几项
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                // "is_cardfive":1,//牌形可选项1
                // "is_cardbomb":1,//牌形可选项2
                // "is_cardtiny":1,//牌形可选项3
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "banker_mode":2,
                "banker_score":4,
                "banker1":"unselected",
                "banker2":"selected",
                "banker3":"unselected",
                "banker4":"unselected",
                "banker5":"unselected",
            },
            //十人牛牛
            "bull6b": localStorage.bull6b && JSON.parse(localStorage.bull6b).ready_time ? JSON.parse(localStorage.bull6b) : {
                "bet_type":1,//下注组合
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                "ticket_type":2,
                "score_type":1,
                "rule_type":2,
                // "is_cardfive":1,
                // "is_cardbomb":1,
                // "is_cardtiny":1,
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "banker_mode":2,
                "banker_score":4,
                "banker1":"unselected",
                "banker2":"selected",
                "banker3":"unselected",
                "banker4":"unselected",
                "banker5":"unselected",
            },
            //9人8倍牛牛
            "bull8b": localStorage.bull8b && JSON.parse(localStorage.bull8b).ready_time ? JSON.parse(localStorage.bull8b) : {
                "ticket_type":2,
                "score_type":1,
                "rule_type":2,
                // "is_cardfive":1,
                "ready_time":'5',
                "grab_time":'5',
                "bet_time":'5',
                "show_time":'5',
                // "is_cardbomb":1,
                // "is_cardtiny":1,
                "is_cardfive":1, //牌型 五花牛(5倍)  1表示默认勾选
                "is_cardbomb":1, //牌型 炸弹牛(6倍)
                "is_cardtiny":1, //牌型 五小牛(8倍)
                "is_cardfour":1, //牌型 四花牛(4倍)
                "is_flush":1,     //牌型 同花牛(6倍)
                "is_calabash":1, //牌型 葫芦牛(6倍)
                "is_straight":1, //牌型 顺子牛(6倍)
                "is_sequence":1, //牌型 同花顺(9倍)
                "banker_mode":2,
                "banker_score":4,
                "banker1":"unselected",
                "banker2":"selected",
                "banker3":"unselected",
                "banker4":"unselected",
                "banker5":"unselected",
            },
            //九人三公
            "sangong9":localStorage.sangong9 ? JSON.parse(localStorage.sangong9) : {
                "ticket_type":1,
                "score_type":1,
                "rule_type":1,   //总是1
                "is_cardjoker":1, //天公x10,雷公x7,地公x5  1表示默认勾选
                "is_cardbao9":1,  //暴玖x9                 1表示默认勾选
                "banker_mode":2, //模式 2 明牌抢庄
                "banker_score":4,
                "banker1":"unselected",
                "banker4":"unselected",
                "banker2":"selected",
            },
            //鱼虾蟹
            "yxx": localStorage.yxx ? JSON.parse(localStorage.yxx) : {
                'chip_type': 1,
                'ticket_type': 1,
                'rule_value1': 1,
                'upper_limit': 100,
            },
            //牌九
            "paijiu":localStorage.paijiu ? JSON.parse(localStorage.paijiu) : {
                "ticket_type":1,
                "score_type":1,
                "banker_mode":2, //模式 2 明牌抢庄
                "banker1":"unselected",
                "banker2":"selected",
            },
            //6人炸金花
            "flower":localStorage.flower ? JSON.parse(localStorage.flower) : {
                'chip_type': 1,
                'ticket_count': 1,
                'default_score': 4,
                'lookvalue': 1,
                'pkvalue1': 0,
                'pkvalue2': 0,
                'only_big': 0,
                'upper_limit': 1000,
            },
            //9人炸金花
            "z9":localStorage.z9 ? JSON.parse(localStorage.z9) : {
                'chip_type': 1,
                'ticket_count': 1,
                'default_score': 4,
                'lookvalue': 0,
                'pkvalue1': 0,
                'pkvalue2': 0,
                'upper_limit': 1000,
            },
            //12人炸金花
            "z12":localStorage.z12 ? JSON.parse(localStorage.z12) : {
                'chip_type': 1,
                'ticket_count': 1,
                'default_score': 4,
                'lookvalue': 0,
                'pkvalue1': 0,
                'pkvalue2': 0,
                'upper_limit': 1000,
            },
            "landlord":localStorage.landlord ? JSON.parse(localStorage.landlord) : {
                "ticket_count":1,
                "base_score":1,
                "ask_mode":2,
            },
            "majiang":localStorage.majiang ? JSON.parse(localStorage.majiang) : {
                "joker":3,
                "horse_count":2,
                "qianggang":1,
                "ticket_count":2,
                "chengbao":1,
            },

            //二八杠
            "erbagang":localStorage.erbagang ? JSON.parse(localStorage.erbagang) : {
                "banker_mode":1,  //模式 1 自由抢庄
                "score_type":1,   //上庄分数类型
                "chip_type":1,   //筹码组选项
                "rule_type":2,    //规则
                "ticket_count":1,
                "banker1":"selected",
                "banker2":"unselected",
            },
            //六人三公
            "sangong6":localStorage.sangong6 ? JSON.parse(localStorage.sangong6) : {
                "ticket_type":1,
                "score_type":1,
                "rule_type":1,   //总是1
                "is_cardjoker":1, //天公x10,雷公x7,地公x5  1表示默认勾选
                "is_cardbao9":1,  //暴玖x9                 1表示默认勾选
                "banker_mode":2, //模式 2 明牌抢庄
                "banker_score":4,
                "banker1":"unselected",
                "banker4":"unselected",
                "banker2":"selected",
            },

            //大吃小 默认建房选项
            "dcx":localStorage.dcx ? JSON.parse(localStorage.dcx) : {
                "max_count_type":1,   // 1九人房  2十二人房
                "ticket_type":1,
                "bet_type":1,
                "is_cardjoker":0, //天公x10,雷公x7,地公x5  1表示默认勾选
                "is_cardbao9":0,  //暴玖x9                 1表示默认勾选
            },

        }

        $scope.selectChange=function(type,num){
            if($scope.createInfo.isShow==26){
                if(type==1){
                    $scope.createInfo.flower.chip_type=num;
                }
                else if(type==2){

                    if (num == 1) {
                        if ($scope.createInfo.flower.pkvalue1 == 0) {
                            $scope.createInfo.flower.pkvalue1 = 1;
                        } else {
                            $scope.createInfo.flower.pkvalue1 = 0;
                        }
                    } else if (num == 2) {
                        if ($scope.createInfo.flower.pkvalue2 == 0) {
                            $scope.createInfo.flower.pkvalue2 = 1;
                        } else {
                            $scope.createInfo.flower.pkvalue2 = 0;
                        }
                    } else if (num == 3) {
                        if ($scope.createInfo.flower.lookvalue == 0) {
                            $scope.createInfo.flower.lookvalue = 1;
                        } else {
                            $scope.createInfo.flower.lookvalue = 0;
                        }
                    }  else if (num == 4) {
                        if ($scope.createInfo.flower.only_big == 0) {
                            $scope.createInfo.flower.only_big = 1;
                        } else {
                            $scope.createInfo.flower.only_big = 0;
                        }
                    }

                }
                else if(type==3){
                    $scope.createInfo.flower.ticket_count=num;
                }
                else if(type==4){
                    $scope.createInfo.flower.upper_limit=num;
                }
                else if(type==5){
                    $scope.createInfo.flower.default_score=num;
                }
            }
            else if($scope.createInfo.isShow==2){
                if (type==1) {
                    $scope.createInfo.landlord.base_score = num;
                } else if (type==2) {
                    $scope.createInfo.landlord.ask_mode = num;
                } else if(type==3) {
                    $scope.createInfo.landlord.ticket_count = num;
                }
            }
            else if($scope.createInfo.isShow==55){
                if(type==1){
                    $scope.createInfo.bull.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.bull.rule_type=num;
                }
                else if(type==3){
                    // if(num==1)
                    //  $scope.createInfo.bull.is_cardfive=($scope.createInfo.bull.is_cardfive+1)%2;
                    // else if(num==2)
                    //  $scope.createInfo.bull.is_cardbomb=($scope.createInfo.bull.is_cardbomb+1)%2;
                    // else if(num==3)
                    //  $scope.createInfo.bull.is_cardtiny=($scope.createInfo.bull.is_cardtiny+1)%2;
                    switch(num){
                        case 1:
                            $scope.createInfo.bull.is_cardfour=($scope.createInfo.bull.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.bull.is_cardfive=($scope.createInfo.bull.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.bull.is_straight=($scope.createInfo.bull.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.bull.is_flush=($scope.createInfo.bull.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.bull.is_calabash=($scope.createInfo.bull.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.bull.is_cardbomb=($scope.createInfo.bull.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.bull.is_sequence=($scope.createInfo.bull.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.bull.is_cardtiny=($scope.createInfo.bull.is_cardtiny+1)%2;
                            break;
                    }
                }
                else if(type==4){
                    $scope.createInfo.bull.ticket_type=num;
                }
                else if (type == 5) {
                    $scope.createInfo.bull.banker_score=num;
                }
                else if(type==6){
                    $scope.createInfo.bull.bet_type=num;
                }
            }
            else if($scope.createInfo.isShow==4){
                if(type==1){
                    $scope.createInfo.majiang.joker=num;
                }
                else if(type==2){
                    $scope.createInfo.majiang.horse_count=num;
                }
                else if(type==3){
                    $scope.createInfo.majiang.qianggang=($scope.createInfo.majiang.qianggang+1)%2;
                }
                else if(type==4){
                    $scope.createInfo.majiang.ticket_count=num;
                }
                else if(type==5){
                    $scope.createInfo.majiang.chengbao=($scope.createInfo.majiang.chengbao+1)%2;
                }
            }
            else if($scope.createInfo.isShow==59){
                if(type==1){
                    $scope.createInfo.bull9.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.bull9.rule_type=num;
                }
                else if(type==3){
                    // if(num==1)
                    //  $scope.createInfo.bull9.is_cardfive=($scope.createInfo.bull9.is_cardfive+1)%2;
                    // else if(num==2)
                    //  $scope.createInfo.bull9.is_cardbomb=($scope.createInfo.bull9.is_cardbomb+1)%2;
                    // else if(num==3)
                    //  $scope.createInfo.bull9.is_cardtiny=($scope.createInfo.bull9.is_cardtiny+1)%2;
                    switch(num){
                        case 1:
                            $scope.createInfo.bull9.is_cardfour=($scope.createInfo.bull9.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.bull9.is_cardfive=($scope.createInfo.bull9.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.bull9.is_straight=($scope.createInfo.bull9.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.bull9.is_flush=($scope.createInfo.bull9.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.bull9.is_calabash=($scope.createInfo.bull9.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.bull9.is_cardbomb=($scope.createInfo.bull9.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.bull9.is_sequence=($scope.createInfo.bull9.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.bull9.is_cardtiny=($scope.createInfo.bull9.is_cardtiny+1)%2;
                            break;
                    }
                }
                else if(type==4){
                    $scope.createInfo.bull9.ticket_type=num;
                }
                else if (type == 5) {
                    $scope.createInfo.bull9.banker_score=num;
                }
                else if(type==6){
                    $scope.createInfo.bull9.bet_type=num;
                }
            }
            else if($scope.createInfo.isShow==52){
                if(type==1){
                    $scope.createInfo.bull12.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.bull12.rule_type=num;
                }
                else if(type==3){
                    // if(num==1)
                    //     $scope.createInfo.bull12.is_cardfive=($scope.createInfo.bull12.is_cardfive+1)%2;
                    // else if(num==2)
                    //     $scope.createInfo.bull12.is_cardbomb=($scope.createInfo.bull12.is_cardbomb+1)%2;
                    // else if(num==3)
                    //     $scope.createInfo.bull12.is_cardtiny=($scope.createInfo.bull12.is_cardtiny+1)%2;
                    switch(num){
                        case 1:
                            $scope.createInfo.bull12.is_cardfour=($scope.createInfo.bull12.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.bull12.is_cardfive=($scope.createInfo.bull12.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.bull12.is_straight=($scope.createInfo.bull12.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.bull12.is_flush=($scope.createInfo.bull12.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.bull12.is_calabash=($scope.createInfo.bull12.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.bull12.is_cardbomb=($scope.createInfo.bull12.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.bull12.is_sequence=($scope.createInfo.bull12.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.bull12.is_cardtiny=($scope.createInfo.bull12.is_cardtiny+1)%2;
                            break;
                    }
                }
                else if(type==4){
                    $scope.createInfo.bull12.ticket_type=num;
                }
                else if(type==6){
                    $scope.createInfo.bull12.bet_type=num;
                }
            }
            else if($scope.createInfo.isShow==7){
                if(type==1){
                    $scope.createInfo.sangong6.score_type=num;
                }
                else if(type==3){
                    if(num==1)
                        $scope.createInfo.sangong6.is_cardjoker=($scope.createInfo.sangong6.is_cardjoker+1)%2;
                    else if(num==2)
                        $scope.createInfo.sangong6.is_cardbao9=($scope.createInfo.sangong6.is_cardbao9+1)%2;
                }
                else if(type==4){
                    $scope.createInfo.sangong6.ticket_type=num;
                }
            }
            else if($scope.createInfo.isShow==8){
                if(type==1){
                    $scope.createInfo.erbagang.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.erbagang.chip_type=num;
                }
                else if(type==3){
                    $scope.createInfo.erbagang.rule_type=num;
                }
                else if(type==4){
                    $scope.createInfo.erbagang.ticket_count=num;
                }
            }
            else if($scope.createInfo.isShow==56){
                if(type==1){
                    $scope.createInfo.bull6b.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.bull6b.rule_type=num;
                }
                else if(type==3){
                    // if(num==1)
                    //  $scope.createInfo.bull6b.is_cardfive=($scope.createInfo.bull6b.is_cardfive+1)%2;
                    // else if(num==2)
                    //  $scope.createInfo.bull6b.is_cardbomb=($scope.createInfo.bull6b.is_cardbomb+1)%2;
                    // else if(num==3)
                    //  $scope.createInfo.bull6b.is_cardtiny=($scope.createInfo.bull6b.is_cardtiny+1)%2;
                    switch(num){
                        case 1:
                            $scope.createInfo.bull6b.is_cardfour=($scope.createInfo.bull6b.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.bull6b.is_cardfive=($scope.createInfo.bull6b.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.bull6b.is_straight=($scope.createInfo.bull6b.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.bull6b.is_flush=($scope.createInfo.bull6b.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.bull6b.is_calabash=($scope.createInfo.bull6b.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.bull6b.is_cardbomb=($scope.createInfo.bull6b.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.bull6b.is_sequence=($scope.createInfo.bull6b.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.bull6b.is_cardtiny=($scope.createInfo.bull6b.is_cardtiny+1)%2;
                            break;
                    }
                }
                else if(type==4){
                    $scope.createInfo.bull6b.ticket_type=num;
                }
                else if (type == 5) {
                    $scope.createInfo.bull6b.banker_score=num;
                }
                else if(type==6){
                    $scope.createInfo.bull6b.bet_type=num;
                }
            }
            else if($scope.createInfo.isShow==30){
                if(type==1){
                    $scope.createInfo.z12.chip_type=num;
                }
                else if(type==2){
                    if (num == 1) {
                        if ($scope.createInfo.z12.pkvalue1 == 0) {
                            $scope.createInfo.z12.pkvalue1 = 1;
                        } else {
                            $scope.createInfo.z12.pkvalue1 = 0;
                        }
                    } else if (num == 2) {
                        if ($scope.createInfo.z12.pkvalue2 == 0) {
                            $scope.createInfo.z12.pkvalue2 = 1;
                        } else {
                            $scope.createInfo.z12.pkvalue2 = 0;
                        }
                    } else if (num == 3) {
                        if ($scope.createInfo.z12.lookvalue == 0) {
                            $scope.createInfo.z12.lookvalue = 1;
                        } else {
                            $scope.createInfo.z12.lookvalue = 0;
                        }
                    }
                }
                else if(type==3){
                    $scope.createInfo.z12.ticket_count=num;
                }
                else if(type==4){
                    $scope.createInfo.z12.upper_limit=num;
                }
                else if(type==5){
                    $scope.createInfo.z12.default_score=num;
                }
                console.log(type,num,$scope.createInfo.z12);
            }
            else if($scope.createInfo.isShow==29){
                if(type==1){
                    $scope.createInfo.z9.chip_type=num;
                }
                else if(type==2){
                    if (num == 1) {
                        if ($scope.createInfo.z9.pkvalue1 == 0) {
                            $scope.createInfo.z9.pkvalue1 = 1;
                        } else {
                            $scope.createInfo.z9.pkvalue1 = 0;
                        }
                    } else if (num == 2) {
                        if ($scope.createInfo.z9.pkvalue2 == 0) {
                            $scope.createInfo.z9.pkvalue2 = 1;
                        } else {
                            $scope.createInfo.z9.pkvalue2 = 0;
                        }
                    } else if (num == 3) {
                        if ($scope.createInfo.z9.lookvalue == 0) {
                            $scope.createInfo.z9.lookvalue = 1;
                        } else {
                            $scope.createInfo.z9.lookvalue = 0;
                        }
                    }
                }
                else if(type==3){
                    $scope.createInfo.z9.ticket_count=num;
                }
                else if(type==4){
                    $scope.createInfo.z9.upper_limit=num;
                }
                else if(type==5){
                    $scope.createInfo.z9.default_score=num;
                }
            }
            else if($scope.createInfo.isShow==58){
                if(type==1){
                    $scope.createInfo.bull8b.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.bull8b.rule_type=num;
                }
                else if(type==3){
                    // if(num==1)
                    //  $scope.createInfo.bull8b.is_cardfive=($scope.createInfo.bull8b.is_cardfive+1)%2;
                    // else if(num==2)
                    //  $scope.createInfo.bull8b.is_cardbomb=($scope.createInfo.bull8b.is_cardbomb+1)%2;
                    // else if(num==3)
                    //  $scope.createInfo.bull8b.is_cardtiny=($scope.createInfo.bull8b.is_cardtiny+1)%2;
                    switch(num){
                        case 1:
                            $scope.createInfo.bull8b.is_cardfour=($scope.createInfo.bull8b.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.bull8b.is_cardfive=($scope.createInfo.bull8b.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.bull8b.is_straight=($scope.createInfo.bull8b.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.bull8b.is_flush=($scope.createInfo.bull8b.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.bull8b.is_calabash=($scope.createInfo.bull8b.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.bull8b.is_cardbomb=($scope.createInfo.bull8b.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.bull8b.is_sequence=($scope.createInfo.bull8b.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.bull8b.is_cardtiny=($scope.createInfo.bull8b.is_cardtiny+1)%2;
                            break;
                    }
                }
                else if(type==4){
                    $scope.createInfo.bull8b.ticket_type=num;
                } else if (type == 5) {
                    $scope.createInfo.bull8b.banker_score=num;
                }
            }
            else if($scope.createInfo.isShow==12){
                if(type==1){
                    $scope.createInfo.paijiu.score_type=num;
                }else if(type==4){
                    $scope.createInfo.paijiu.ticket_type=num;
                }
            }
            else if($scope.createInfo.isShow==14){
                if(type==1){
                    $scope.createInfo.dcx.bet_type=num;
                } else if(type==3){
                    if(num==1)
                        $scope.createInfo.dcx.is_cardjoker=($scope.createInfo.dcx.is_cardjoker+1)%2;
                    else if(num==2)
                        $scope.createInfo.dcx.is_cardbao9=($scope.createInfo.dcx.is_cardbao9+1)%2;
                } else if(type==4){
                    $scope.createInfo.dcx.ticket_type=num;
                } else if(type==6){
                    $scope.createInfo.dcx.max_count_type=num;
                }
            }
            else if($scope.createInfo.isShow==15){
                if(type==1){
                    $scope.createInfo.yxx.chip_type=num;
                } else if(type==2){
                    if (num == 1) {
                        $scope.createInfo.yxx.rule_value1 = ($scope.createInfo.yxx.rule_value1+1)%2;
                    }
                }
                else if(type==3){
                    $scope.createInfo.yxx.ticket_type=num;
                }
                else if(type==4){
                    $scope.createInfo.yxx.upper_limit=num;
                }
            }
            else if($scope.createInfo.isShow==16){
                if(type==1){
                    $scope.createInfo.sangong9.score_type=num;
                }
                else if(type==3){
                    if(num==1)
                        $scope.createInfo.sangong9.is_cardjoker=($scope.createInfo.sangong9.is_cardjoker+1)%2;
                    else if(num==2)
                        $scope.createInfo.sangong9.is_cardbao9=($scope.createInfo.sangong9.is_cardbao9+1)%2;
                }
                else if(type==4){
                    $scope.createInfo.sangong9.ticket_type=num;
                }
            }
            else if($scope.createInfo.isShow==53){
                if(type==1){
                    $scope.createInfo.laibull.score_type=num;
                }
                else if(type==2){
                    $scope.createInfo.laibull.rule_type=num;
                }
                else if(type==3){
                    switch(num){
                        case 1:
                            $scope.createInfo.laibull.is_cardfour=($scope.createInfo.laibull.is_cardfour+1)%2;
                            break;
                        case 2:
                            $scope.createInfo.laibull.is_cardfive=($scope.createInfo.laibull.is_cardfive+1)%2;
                            break;
                        case 3:
                            $scope.createInfo.laibull.is_straight=($scope.createInfo.laibull.is_straight+1)%2;
                            break;
                        case 4:
                            $scope.createInfo.laibull.is_flush=($scope.createInfo.laibull.is_flush+1)%2;
                            break;
                        case 5:
                            $scope.createInfo.laibull.is_calabash=($scope.createInfo.laibull.is_calabash+1)%2;
                            break;
                        case 6:
                            $scope.createInfo.laibull.is_cardbomb=($scope.createInfo.laibull.is_cardbomb+1)%2;
                            break;
                        case 7:
                            $scope.createInfo.laibull.is_sequence=($scope.createInfo.laibull.is_sequence+1)%2;
                            break;
                        case 8:
                            $scope.createInfo.laibull.is_cardtiny=($scope.createInfo.laibull.is_cardtiny+1)%2;
                            break;
                        case 0:
                            $scope.createInfo.laibull.is_laizi=($scope.createInfo.laibull.is_laizi+1)%2;
                            break;

                    }
                }
                else if(type==4){
                    $scope.createInfo.laibull.ticket_type=num;
                } else if (type == 5) {
                    $scope.createInfo.laibull.max_count_type=num;
                } else if(type==6){
                    $scope.createInfo.laibull.bet_type=num;
                }

            }
            else if($scope.createInfo.isShow==24){
                if(type==1){
                    //$scope.createInfo.flower18.max_count_type=num;
                } else if(type==2){
                    $scope.createInfo.flower18.default_score=num;
                } else if(type==3){
                    $scope.createInfo.flower18.chip_type=num;
                } else if(type==4){
                    if (num == 1) {
                        $scope.createInfo.flower18.disable_look=($scope.createInfo.flower18.disable_look+1)%2;
                    } else if (num == 2) {
                        $scope.createInfo.flower18.disable_pk=($scope.createInfo.flower18.disable_pk+1)%2;
                    }
                } else if(type==5){
                    $scope.createInfo.flower18.upper_limit=num;
                } else if(type==6){
                    $scope.createInfo.flower18.pk_score=num;
                } else if(type==7){
                    $scope.createInfo.flower18.look_score=num;
                } else if(type==8){
                    $scope.createInfo.flower18.ticket_type=num;
                }
            }
            else if($scope.createInfo.isShow==25){  //血拼金花
                if(type==2){
                    $scope.createInfo.flowerxp.default_score=num;
                } else if(type==3){
                    $scope.createInfo.flowerxp.chip_type=num;
                } else if(type==4){
                    if (num == 2) {
                        $scope.createInfo.flowerxp.disable_pk=($scope.createInfo.flowerxp.disable_pk+1)%2;
                    }
                } else if(type==5){
                    $scope.createInfo.flowerxp.bet_circle=num;
                } else if(type==6){
                    $scope.createInfo.flowerxp.look_cond=num;
                } else if(type==7){
                    $scope.createInfo.flowerxp.pk_cond=num;
                } else if(type==8){
                    $scope.createInfo.flowerxp.xp_circle=num;
                } else if(type==9){
                    $scope.createInfo.flowerxp.ticket_type=num;
                }
            }


        }

        //血拼金花选筹码方法
        $scope.changeRule=function(e, t){
            var flowerxp = $scope.createInfo.flowerxp;

            if("chip_list"==e){
                if(4==flowerxp.chip_list.length&&!flowerxp.chip_total[t].isSelect){
                    return void $scope.showAlertTip("已选择四组筹码",2);
                }
                flowerxp.chip_total[t].isSelect=!flowerxp.chip_total[t].isSelect;
                flowerxp.chip_list=[];
                for(var a=0;a<flowerxp.chip_total.length;a++){
                    if(flowerxp.chip_total[a].isSelect){
                        flowerxp.chip_list.push(flowerxp.chip_total[a].num);
                    }
                }
                //根据血拼筹码基准定血拼筹码
                if(flowerxp.chip_list.length>=1){
                    flowerxp.base_xp_chip=flowerxp.chip_list[flowerxp.chip_list.length-1];
                    if(flowerxp.base_xp_chip<40){
                        flowerxp.base_xp_chip=40;
                    }
                } else {
                    flowerxp.base_xp_chip=40;
                }
                flowerxp.xp_chip=3*flowerxp.base_xp_chip;
            } else if("xp_chip"==e){
                flowerxp.xp_chip=t
            }
        }
        $scope.createFlowerXp=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=25;
        }

        $scope.createSg9=function(){
            $(".createRoom .mainPart").css('height','71vh');
            $(".createRoom .mainPart .blueBack").css('height','50vh');
            $scope.createInfo.isShow=16;
        }

        $scope.createYxx=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=15;
        }

        $scope.createDcx=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=14;
        }


        $scope.createPaijiu=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=12;
        }

        $scope.createFlower=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=26;
        }
        $scope.createFlower18=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=24;
        }
        $scope.createZ9=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=29;
        }
        $scope.createZ12=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=30;
        }
        $scope.createLandlord=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=2;
        }
        $scope.createSg=function(){
            $(".createRoom .mainPart").css('height','71vh');
            $(".createRoom .mainPart .blueBack").css('height','50vh');
            $scope.createInfo.isShow=7;
        }
        $scope.createEba=function(){
            $(".createRoom .mainPart").css('height','71vh');
            $(".createRoom .mainPart .blueBack").css('height','50vh');
            $scope.createInfo.isShow=8;
        }
        $scope.createMajiang=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=4;
        }

        $scope.createBull=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=55;
        }
        $scope.createBull9=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=59;
        }
        $scope.createBull12=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=52;
        }
        $scope.createBull6b=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=56;
        }
        $scope.createBull8b=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=58;
        }
        $scope.createLaiBull=function(){
            $(".createRoom .mainPart").css('height','');
            $(".createRoom .mainPart .blueBack").css('height','');
            $scope.createInfo.isShow=53;
        }

        //明牌炸金花选模式
        $scope.selectModeFlower18 = function (type) {
            $scope.createInfo.flower18.mode1 = "unselected";
            $scope.createInfo.flower18.mode2 = "unselected";
            $scope.createInfo.flower18['mode'+type] = "selected";
            $scope.createInfo.flower18.play_mode = type;
        };

        $scope.selectBankerModeLaibull = function (type) {
            $scope.createInfo.laibull.banker1 = "unselected";
            $scope.createInfo.laibull.banker2 = "unselected";
            $scope.createInfo.laibull['banker'+type] = "selected";
            $scope.createInfo.laibull.banker_mode = type;
        };



        $scope.selectBankerModeSangong9 = function (type) {
            $scope.createInfo.sangong9['banker1'] = "unselected";
            $scope.createInfo.sangong9['banker2'] = "unselected";
            $scope.createInfo.sangong9['banker4'] = "unselected";
            $scope.createInfo.sangong9['banker' + type] =  "selected";

            $scope.createInfo.sangong9.score_type = 1;
            $scope.createInfo.sangong9.banker_mode = type;
        };


        $scope.selectBankerModePaijiu = function (type) {
            $scope.createInfo.paijiu.banker1 = "unselected";
            $scope.createInfo.paijiu.banker2 = "unselected";
            $scope.createInfo.paijiu['banker'+type] = "selected";
            $scope.createInfo.paijiu.banker_mode = type;
        };

        $scope.selectBankerMode = function (type) {
            if (type == 1) {
                $scope.createInfo.bull.score_type = 1;
                $scope.createInfo.bull.banker1 = "selected";
                $scope.createInfo.bull.banker2 = "unselected";
                $scope.createInfo.bull.banker3 = "unselected";
                $scope.createInfo.bull.banker4 = "unselected";
                $scope.createInfo.bull.banker5 = "unselected";
            } else if (type == 2) {
                $scope.createInfo.bull.score_type = 1;
                $scope.createInfo.bull.banker1 = "unselected";
                $scope.createInfo.bull.banker2 = "selected";
                $scope.createInfo.bull.banker3 = "unselected";
                $scope.createInfo.bull.banker4 = "unselected";
                $scope.createInfo.bull.banker5 = "unselected";
            } else if (type == 3) {
                $scope.createInfo.bull.score_type = 1;
                $scope.createInfo.bull.banker1 = "unselected";
                $scope.createInfo.bull.banker2 = "unselected";
                $scope.createInfo.bull.banker3 = "selected";
                $scope.createInfo.bull.banker4 = "unselected";
                $scope.createInfo.bull.banker5 = "unselected";
            } else if (type == 4) {
                $scope.createInfo.bull.score_type = 4;
                $scope.createInfo.bull.banker1 = "unselected";
                $scope.createInfo.bull.banker2 = "unselected";
                $scope.createInfo.bull.banker3 = "unselected";
                $scope.createInfo.bull.banker4 = "selected";
                $scope.createInfo.bull.banker5 = "unselected";
            } else if (type == 5) {
                $scope.createInfo.bull.score_type = 1;
                $scope.createInfo.bull.banker1 = "unselected";
                $scope.createInfo.bull.banker2 = "unselected";
                $scope.createInfo.bull.banker3 = "unselected";
                $scope.createInfo.bull.banker4 = "unselected";
                $scope.createInfo.bull.banker5 = "selected";
            }

            $scope.createInfo.bull.banker_mode = type;
        };

        $scope.selectBankerMode9 = function (type) {
            if (type == 1) {
                $scope.createInfo.bull9.score_type = 1;
                $scope.createInfo.bull9.banker1 = "selected";
                $scope.createInfo.bull9.banker2 = "unselected";
                $scope.createInfo.bull9.banker3 = "unselected";
                $scope.createInfo.bull9.banker4 = "unselected";
                $scope.createInfo.bull9.banker5 = "unselected";
            } else if (type == 2) {
                $scope.createInfo.bull9.score_type = 1;
                $scope.createInfo.bull9.banker1 = "unselected";
                $scope.createInfo.bull9.banker2 = "selected";
                $scope.createInfo.bull9.banker3 = "unselected";
                $scope.createInfo.bull9.banker4 = "unselected";
                $scope.createInfo.bull9.banker5 = "unselected";
            } else if (type == 3) {
                $scope.createInfo.bull9.score_type = 1;
                $scope.createInfo.bull9.banker1 = "unselected";
                $scope.createInfo.bull9.banker2 = "unselected";
                $scope.createInfo.bull9.banker3 = "selected";
                $scope.createInfo.bull9.banker4 = "unselected";
                $scope.createInfo.bull9.banker5 = "unselected";
            } else if (type == 4) {
                $scope.createInfo.bull9.score_type = 4;
                $scope.createInfo.bull9.banker1 = "unselected";
                $scope.createInfo.bull9.banker2 = "unselected";
                $scope.createInfo.bull9.banker3 = "unselected";
                $scope.createInfo.bull9.banker4 = "selected";
                $scope.createInfo.bull9.banker5 = "unselected";
            } else if (type == 5) {
                $scope.createInfo.bull9.score_type = 1;
                $scope.createInfo.bull9.banker1 = "unselected";
                $scope.createInfo.bull9.banker2 = "unselected";
                $scope.createInfo.bull9.banker3 = "unselected";
                $scope.createInfo.bull9.banker4 = "unselected";
                $scope.createInfo.bull9.banker5 = "selected";
            }

            $scope.createInfo.bull9.banker_mode = type;
        };

        $scope.selectBankerMode6b = function (type) {
            if (type == 1) {
                $scope.createInfo.bull6b.score_type = 1;
                $scope.createInfo.bull6b.banker1 = "selected";
                $scope.createInfo.bull6b.banker2 = "unselected";
                $scope.createInfo.bull6b.banker3 = "unselected";
                $scope.createInfo.bull6b.banker4 = "unselected";
                $scope.createInfo.bull6b.banker5 = "unselected";
            } else if (type == 2) {
                $scope.createInfo.bull6b.score_type = 1;
                $scope.createInfo.bull6b.banker1 = "unselected";
                $scope.createInfo.bull6b.banker2 = "selected";
                $scope.createInfo.bull6b.banker3 = "unselected";
                $scope.createInfo.bull6b.banker4 = "unselected";
                $scope.createInfo.bull6b.banker5 = "unselected";
            } else if (type == 3) {
                $scope.createInfo.bull6b.score_type = 1;
                $scope.createInfo.bull6b.banker1 = "unselected";
                $scope.createInfo.bull6b.banker2 = "unselected";
                $scope.createInfo.bull6b.banker3 = "selected";
                $scope.createInfo.bull6b.banker4 = "unselected";
                $scope.createInfo.bull6b.banker5 = "unselected";
            } else if (type == 4) {
                $scope.createInfo.bull6b.score_type = 4;
                $scope.createInfo.bull6b.banker1 = "unselected";
                $scope.createInfo.bull6b.banker2 = "unselected";
                $scope.createInfo.bull6b.banker3 = "unselected";
                $scope.createInfo.bull6b.banker4 = "selected";
                $scope.createInfo.bull6b.banker5 = "unselected";
            } else if (type == 5) {
                $scope.createInfo.bull6b.score_type = 1;
                $scope.createInfo.bull6b.banker1 = "unselected";
                $scope.createInfo.bull6b.banker2 = "unselected";
                $scope.createInfo.bull6b.banker3 = "unselected";
                $scope.createInfo.bull6b.banker4 = "unselected";
                $scope.createInfo.bull6b.banker5 = "selected";
            }

            $scope.createInfo.bull6b.banker_mode = type;
        };

        $scope.selectBankerMode8b = function (type) {
            if (type == 1) {
                $scope.createInfo.bull8b.score_type = 1;
                $scope.createInfo.bull8b.banker1 = "selected";
                $scope.createInfo.bull8b.banker2 = "unselected";
                $scope.createInfo.bull8b.banker3 = "unselected";
                $scope.createInfo.bull8b.banker4 = "unselected";
                $scope.createInfo.bull8b.banker5 = "unselected";
            } else if (type == 2) {
                $scope.createInfo.bull8b.score_type = 1;
                $scope.createInfo.bull8b.banker1 = "unselected";
                $scope.createInfo.bull8b.banker2 = "selected";
                $scope.createInfo.bull8b.banker3 = "unselected";
                $scope.createInfo.bull8b.banker4 = "unselected";
                $scope.createInfo.bull8b.banker5 = "unselected";
            } else if (type == 3) {
                $scope.createInfo.bull8b.score_type = 1;
                $scope.createInfo.bull8b.banker1 = "unselected";
                $scope.createInfo.bull8b.banker2 = "unselected";
                $scope.createInfo.bull8b.banker3 = "selected";
                $scope.createInfo.bull8b.banker4 = "unselected";
                $scope.createInfo.bull8b.banker5 = "unselected";
            } else if (type == 4) {
                $scope.createInfo.bull8b.score_type = 4;
                $scope.createInfo.bull8b.banker1 = "unselected";
                $scope.createInfo.bull8b.banker2 = "unselected";
                $scope.createInfo.bull8b.banker3 = "unselected";
                $scope.createInfo.bull8b.banker4 = "selected";
                $scope.createInfo.bull8b.banker5 = "unselected";
            } else if (type == 5) {
                $scope.createInfo.bull8b.score_type = 1;
                $scope.createInfo.bull8b.banker1 = "unselected";
                $scope.createInfo.bull8b.banker2 = "unselected";
                $scope.createInfo.bull8b.banker3 = "unselected";
                $scope.createInfo.bull8b.banker4 = "unselected";
                $scope.createInfo.bull8b.banker5 = "selected";
            }

            $scope.createInfo.bull8b.banker_mode = type;
        };

        $scope.selectBankerModeSangong6 = function (type) {
            $scope.createInfo.sangong6['banker1'] = "unselected";
            $scope.createInfo.sangong6['banker2'] = "unselected";
            $scope.createInfo.sangong6['banker4'] = "unselected";
            $scope.createInfo.sangong6['banker' + type] =  "selected";

            $scope.createInfo.sangong6.score_type = 1;
            $scope.createInfo.sangong6.banker_mode = type;
        };

        $scope.selectBankerModeErbagang = function (type) {
            if (type == 1) {
                $scope.createInfo.erbagang.banker1 = "selected";
                $scope.createInfo.erbagang.banker2 = "unselected";
                $scope.createInfo.erbagang.chip_type = 1;
            } else if (type == 2) {
                $scope.createInfo.erbagang.banker1 = "unselected";
                $scope.createInfo.erbagang.banker2 = "selected";
                $scope.createInfo.erbagang.score_type = 1;
            }
            $scope.createInfo.erbagang.banker_mode = type;
        };

        $scope.createCommit = function () {
            if ($scope.userInfo.card>0){
                if($scope.is_operation){
                    return 0;
                }
                //血拼金花新增建房判断
                if($scope.createInfo.isShow==25 && 4!=$scope.createInfo.flowerxp.chip_list.length){
                    return void $scope.showAlertTip("请选择4组筹码",2);
                }
                $scope.waiting();
                //$scope.createHttpRoom();

                if($scope.createInfo.isShow==26){
                    //errorAPI("startConnect",$scope.socket.flower);
                    $scope.connectSocket($scope.socket.flower,26);
                    localStorage.flower = JSON.stringify($scope.createInfo.flower);
                    //$scope.createHttpRoom();
                }
                else if($scope.createInfo.isShow==2){
                    //errorAPI("startConnect",$scope.socket.landlord);
                    $scope.connectSocket($scope.socket.landlord,2);
                    localStorage.landlord = JSON.stringify($scope.createInfo.landlord);
                    //$scope.createHttpRoom();
                }

                else if($scope.createInfo.isShow==4){
                    //errorAPI("startConnect",$scope.socket.majiang);
                    $scope.connectSocket($scope.socket.majiang,4);
                    localStorage.majiang = JSON.stringify($scope.createInfo.majiang);
                    //$scope.createHttpRoom();
                }
                else if($scope.createInfo.isShow==7){
                    //errorAPI("startConnect",$scope.socket.sg);
                    $scope.connectSocket($scope.socket.sg,7);
                    localStorage.sangong6 = JSON.stringify($scope.createInfo.sangong6);
                }
                else if($scope.createInfo.isShow==8){
                    //errorAPI("startConnect",$scope.socket.eba);
                    $scope.connectSocket($scope.socket.eba,8);
                    localStorage.erbagang = JSON.stringify($scope.createInfo.erbagang);
                }

                else if($scope.createInfo.isShow==29){
                    //errorAPI("startConnect",$scope.socket.z9);
                    $scope.connectSocket($scope.socket.z9,29);
                    localStorage.z9 = JSON.stringify($scope.createInfo.z9);
                }
                else if($scope.createInfo.isShow==30){
                    //errorAPI("startConnect",$scope.socket.z9);
                    $scope.connectSocket($scope.socket.z12,30);
                    localStorage.z12 = JSON.stringify($scope.createInfo.z12);
                }

                else if($scope.createInfo.isShow==12){
                    //errorAPI("startConnect",$scope.socket.paijiu);
                    $scope.connectSocket($scope.socket.paijiu,12);
                    localStorage.paijiu = JSON.stringify($scope.createInfo.paijiu);
                }
                else if($scope.createInfo.isShow==14){
                    //errorAPI("startConnect",$scope.socket.sg9);
                    $scope.connectSocket($scope.socket.dcx,14);
                    localStorage.dcx = JSON.stringify($scope.createInfo.dcx);
                }
                else if($scope.createInfo.isShow==15){
                    //errorAPI("startConnect",$scope.socket.sg9);
                    $scope.connectSocket($scope.socket.yxx,15);
                    localStorage.yxx = JSON.stringify($scope.createInfo.yxx);
                }
                else if($scope.createInfo.isShow==16){
                    //errorAPI("startConnect",$scope.socket.sg9);
                    $scope.connectSocket($scope.socket.sg9,16);
                    localStorage.sangong9 = JSON.stringify($scope.createInfo.sangong9);
                }

                else if($scope.createInfo.isShow==24){
                    $scope.connectSocket($scope.socket.mpzjh,24);
                    localStorage.flower18 = JSON.stringify($scope.createInfo.flower18);
                }
                else if($scope.createInfo.isShow==25){
                    $scope.connectSocket($scope.socket.xpzjh,25);
                    localStorage.flowerxp = JSON.stringify($scope.createInfo.flowerxp);
                }
                else if($scope.createInfo.isShow==55){
                    //errorAPI("startConnect",$scope.socket.bull);
                    $scope.connectSocket($scope.socket.bull,55);
                    localStorage.bull = JSON.stringify($scope.createInfo.bull);
                    //$scope.createHttpRoom();
                }
                else if($scope.createInfo.isShow==59){
                    //errorAPI("startConnect",$scope.socket.bull9);
                    $scope.connectSocket($scope.socket.bull9,59);
                    localStorage.bull9 = JSON.stringify($scope.createInfo.bull9);
                }
                else if($scope.createInfo.isShow==52){
                    //errorAPI("startConnect",$scope.socket.bull12);
                    $scope.connectSocket($scope.socket.bull12,52);
                    localStorage.bull12 = JSON.stringify($scope.createInfo.bull12);
                }
                else if($scope.createInfo.isShow==56){
                    //errorAPI("startConnect",$scope.socket.bull6b);
                    $scope.connectSocket($scope.socket.bull6b,56);
                    localStorage.bull6b = JSON.stringify($scope.createInfo.bull6b);
                }
                else if($scope.createInfo.isShow==58){
                    //errorAPI("startConnect",$scope.socket.bull8b);
                    $scope.connectSocket($scope.socket.bull8b,58);
                    localStorage.bull8b = JSON.stringify($scope.createInfo.bull8b);
                }
                else if($scope.createInfo.isShow==53){
                    $scope.connectSocket($scope.socket.laibull,53);
                    localStorage.laibull = JSON.stringify($scope.createInfo.laibull);
                }
            }
            else{
                $scope.showAlert(1,"房卡不足");
            }
        }
        $scope.cancelCreate=function(){
            $scope.createInfo.isShow=0;
        }

        $scope.isShowShop=false
        $scope.showShop=function(){
            return 0;
            //alert('hello');
            $scope.select=1;
            $scope.ticket_count=20;

            $scope.isShowShop=true;
            setTimeout(function(){$(".shop .shopBody").animate({"height":$scope.width*1.541+"px"});},0);
        }
        $scope.hideShop=function(){
            $(".shop .shopBody").animate({"height":0},function(){
                $scope.isShowShop=false;
                $scope.$apply();
            })
        }
        $scope.select=1;
        $scope.ticket_count=20;
        $scope.selectCard=function(num,count){
            $scope.select=num;
            $scope.ticket_count=count;
        };
        $scope.isShowShopLoading=false;

    })
    function randomString(len) {
        len = len || 32;
        var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
        var maxPos = $chars.length;
        var pwd = '';
        for (i = 0; i < len; i++) {
            pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
        }
        return pwd;
    }

</script>
<script>
    customInit();
    function customInit(){
        $(".createRoom .mainPart").css('display','block');
        $(".createRoom .mainPart").find(".selectPart").css('display','block');
    }

function show(){
	layer.open({
	  type: 0
	  ,title: false //不显示标题栏
	  ,closeBtn: true
	  ,area: '350px;'
	  ,shade: 0.01
	  ,offset: '22px'
	  ,shadeClose:true
	  ,anim: 6
	  ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
	  ,resize: false
	  ,btn: [ '前往下载APP']
	  ,btnAlign: 'c'
	  ,content: '<img  style="width:100%" src="<?php echo $image_url;?>activity/downs2.jpg">'
	  ,yes: function(index, layero){window.location.href="http://mmka.bopulse.com.cn/gHaIT2";}
	});
}
</script>
</body>
</html>
